Hi, Ben,

FastBit does not have the function MONTH(FROM_UNIXTIME(last_switch)). 
  Unfortunately, it does not support user-defined function at this 
point, so you won't be able to convert a unix time stamp to month at 
this point in time.

One possible way to approximate the months after epoch is dividing by 
1,909,746 (= 365.2425 * 24 * 3600 / 12), e.g.,

select floor(last_switch/1909746) as mth, sum(bytes)

Of course, this may not be acceptable, in which case, you will need to 
compute the month else where and input it to FastBit.

John


On 3/20/2011 4:37 PM, Ben WIlliams wrote:
> In mySQL I would query like this for monthly reports:
>
> SELECT MONTH(FROM_UNIXTIME(last_switch)) AS MTH, SUM(bytes) GROUP BY MTH;
>
> But is it possible to do this query on Fastbit databases?
>
> Ben
>
> On Thu, Mar 17, 2011 at 10:11 PM, Jaime Nebrera
> <[email protected]>  wrote:
>>   Hi Ben,
>>
>>> Good to know someone else is trying this as well.
>>
>>   :)
>>
>>> What are you using
>>> for web development?
>>
>>   RoR
>>
>>   We did some other product based on RoR and we plan to use the same for
>> this. Actually, it will be our first fully open source product.
>>
>>> Do you use the fbquery utility to get the data
>>> out of fastbit?
>>
>>   Yep at this moment.
>>
>>   We asked into the fastbit list too to see if there was a better way to do
>> it.
>>
>>   One thing I'm considering is to mix SQL with fastbit. SQL for some basic
>> data (say top X) and then fastbit for digging.
>>
>>   Thus, initial graphs, basic queries etc could go directly from the
>> database. Also, as the number of values stored in that database would be
>> small it would be ok for performance. Last, as you have fastbit behind, you
>> dont loose data.
>>
>>   You can see our current Flow Collector product here:
>>
>> http://eneotecnologia.com/products_en.html
>>
>>   Sadly, at this moment is still proprietary but we hope to make it open
>> source very soon (we are replacing some proprietary libraries) At the same
>> time, its design is a bit special and thats why we hope to replace it with a
>> new web framework.
>>
>>
>>> Sorry I don't have an answer; I was just going to do
>>> separate queries for each time period.
>>
>>   Well, what are you doing in this area? We are quite eager to collaborate in
>> this effort with other people :D
>>
>>
>> --
>> Jaime Nebrera - [email protected]
>> Consultor TI - ENEO Tecnologia SL
>> C/ Manufactura 2, Edificio Euro, Oficina 3N
>> Mairena del Aljarafe - 41927 - Sevilla
>> Telf.- 955 60 11 60 / 619 04 55 18
>>
>> _______________________________________________
>> Ntop-misc mailing list
>> [email protected]
>> http://listgateway.unipi.it/mailman/listinfo/ntop-misc
>>
> _______________________________________________
> FastBit-users mailing list
> [email protected]
> https://hpcrdm.lbl.gov/cgi-bin/mailman/listinfo/fastbit-users
_______________________________________________
FastBit-users mailing list
[email protected]
https://hpcrdm.lbl.gov/cgi-bin/mailman/listinfo/fastbit-users

Reply via email to