mesos-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Yan Xu <>
Subject Duration-Time related refactoring chain
Date Tue, 14 May 2013 18:51:37 GMT
Some changes on the same class appears that they could be consolidated but
it wasn't easy to do so and I think there is merit in keeping the history.

## Bug Fix
1. Fixed Duration's stream insertion operator so that the output string
does not have trailing zeros after the decimal point. (libstout):

## Clock::now() returns "double -> Duration"

2. Added a default constructor for Seconds for Clock::now() to return
Seconds. (libstout):
3. Updated Clock::now() and Clock::now(ProcessBase*) to return a "Seconds".
4. Updates due to Clock::now() and Clock::now(ProcessBase*) now returning a

## Storing integer in Duration
- Per our initial discussion we decided to keep the constructors using
doubles because some third-party APIs still use them.

5. Changed Duration to use int64_t to store the value in nanoseconds for
better precision. (libstout):
6. Fix due to Seconds can no longer hold DBL_MAX correctly. (libprocess):

## Time
7. Added a Time class as a new abstraction that works with Duration for
various time related calculations. (libprocess):
8. Replaced usage of "Seconds" and "Duration" that represents time with the
new "Time". (libprocess):

## Duration adopts integer constructors
- We now decided to get rid of "double" constructors. For cases where a
Duration needs to be constructed from a "double", a Try method is added.

9. Changed Duration to 1) use integers in constructors; 2) include
overloaded multiplication & division operators. (libstout):
10. Fixes in libprocess due to the new Duration API. (libprocess):
11. Fixes due to the new Duration API. (Mesos):

## More Refactoring on eliminating time in the "double" type.
12. Changed various *time* variables to use the "Time" type instead of


Jiang Yan Xu <> @xujyan <>

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message