Hi Daniel,
On 04/23/2013 08:51 PM, Daniel-Constantin Mierla wrote:
- the tm variable is declared set, but not used
- tz is also not used, gettimeofday() can take NULL as second parameter
and iirc, tz is obsolete
- I wonder if gettimeofday() can actually fail and return code should be
checked for error cases
I'll check with my colleagues regarding these questions and regarding a
final patch, as it might have been modified in the meanwhile (the "live"
version is at
https://github.com/sipwise/kamailio).
- the names of the new column, respectively
'time_hires' sounds a bit
strange to me, does it have any special meaning the word 'hires'?
It's "hires" as in "high resolution" for the timestamp value.
Overall, wouldn't be better to keep the seconds
and microseconds (as
returned in a timeval structure) in separate columns. That means keeping
the time column as it is and adding a new column for microsecs. Then
people can get the precision as they want, including only down to the
miliseconds if that is what they need.
The time column is still being filled as usual, so you can just stay
with that format. However, the problem with this column is its date-time
format, which causes lots of problems for calls going over daylight
saving time changes and when it comes to handling different time zones
in general, so time_hires uses a unix-timestamp with 3 digit precision,
which makes this much easier to handle. And then again, if you want to
use the time_hires column, you can still do from_unixtime in mysql to
get a normal datetime format in seconds precision, no need to handle
seconds and milliseconds separately.
I will add these notes on the tracker so it can be continued there for
development.
Alright, we'll continue from there and push this forward also on our
side to get it to upstream.
Andreas