Layout

At construction it is configured with how the snapshots should be organized into buckets. How many and the space in time between them.

It is then updated with the current layout on the storage medium.

The only data that it relies on is the basename of the paths that are pushed to it.

It operates on two passes. The first pass is basically a histogram. It finds the bucket interval that *contain* the snapshot. It then checks to see if the candidate is newer than the one currently in the bucket. If so it replaces it. This mean that each bucket contains the latest snapshot that fit it. If a snapshot do not fit in a bucket or is replaced it is moved to the discarded list.

The second pass goes through those that has been marked for discard and see if any of them fit *well enough* into the buckets that are empty.

Constructors

this
this(SysTime start, LayoutConfig conf)
Undocumented in source.

Members

Functions

bestFitBucket
Nullable!Snapshot bestFitBucket(SysTime time)
dup
Layout dup()
Undocumented in source. Be warned that the author may not have intended to support it.
empty
bool empty()
Undocumented in source. Be warned that the author may not have intended to support it.
finalize
void finalize()
Undocumented in source. Be warned that the author may not have intended to support it.
firstFullBucket
Nullable!Snapshot firstFullBucket()
Undocumented in source. Be warned that the author may not have intended to support it.
isFirstBucketEmpty
bool isFirstBucketEmpty()
Undocumented in source. Be warned that the author may not have intended to support it.
put
void put(Snapshot s)
Undocumented in source. Be warned that the author may not have intended to support it.
resume
Nullable!Snapshot resume()
snapshotTimeInBucket
Nullable!SysTime snapshotTimeInBucket(size_t idx)
toString
string toString()
Undocumented in source. Be warned that the author may not have intended to support it.
toString
void toString(Writer w)
Undocumented in source. Be warned that the author may not have intended to support it.

Variables

buckets
Bucket[] buckets;
Undocumented in source.
conf
LayoutConfig conf;

The config which can be used to regenerate the layout.

discarded
Snapshot[] discarded;

Snapshots that has been discarded because they do are not the best fit for any bucket.

times
const(Interval!SysTime)[] times;

The time of the bucket which a snapshot should try to match.

Meta