Commit Graph

24 Commits

Author SHA1 Message Date
Matt T. Proud fa6a1f97d0 Expose interfaces for pruner and make pruner tool.
In order to run database cleanups and diagnostics, we should have
a means for pruning a database---even if LevelDB does this for us.
2013-05-10 17:07:03 +02:00
Matt T. Proud b3e34c6658 Implement batch database sample curator.
This commit introduces to Prometheus a batch database sample curator,
which corroborates the high watermarks for sample series against the
curation watermark table to see whether a curator of a given type
needs to be run.

The curator is an abstract executor, which runs various curation
strategies across the database.  It remarks the progress for each
type of curation processor that runs for a given sample series.

A curation procesor is responsible for effectuating the underlying
batch changes that are request.  In this commit, we introduce the
CompactionProcessor, which takes several bits of runtime metadata and
combine sparse sample entries in the database together to form larger
groups.  For instance, for a given series it would be possible to
have the curator effectuate the following grouping:

- Samples Older than Two Weeks: Grouped into Bunches of 10000
- Samples Older than One Week: Grouped into Bunches of 1000
- Samples Older than One Day: Grouped into Bunches of 100
- Samples Older than One Hour: Grouped into Bunches of 10

The benefits hereof of such a compaction are 1. a smaller search
space in the database keyspace, 2. better employment of compression
for repetious values, and 3. reduced seek times.
2013-04-27 17:38:18 +02:00
Matt T. Proud a55602df4a Validate diskFrontier domain for series candidate.
It is the case with the benchmark tool that we thought that we
generated multiple series and saved them to the disk as such, when
in reality, we overwrote the fields of the outgoing metrics via
Go map reference behavior.  This was accidental.  In the course of
diagnosing this, a few errors were found:

1. ``newSeriesFrontier`` should check to see if the candidate fingerprint is within the given domain of the ``diskFrontier``.  If not, as the contract in the docstring stipulates, a ``nil`` ``seriesFrontier`` should be emitted.

2. In the interests of aiding debugging, the raw LevelDB ``levigoIterator`` type now includes a helpful forensics ``String()`` method.

This work produced additional cleanups:

1. ``Close() error`` with the storage stack is technically incorrect, since nowhere in the bowels of it does an error actually occur.  The interface has been simplified to remove this for now.
2013-04-09 11:47:16 +02:00
Matt T. Proud c3e3460ca6 Spin up curator run in the tests.
After this commit, we'll need to add validations that it does the
desired work, which we presently know that it doesn't.  Given the
changes I made with a plethora of renamings, I want to commit this
now before it gets even larger.
2013-04-05 13:55:11 +02:00
Matt T. Proud c53a72a894 Test data for the curator. 2013-03-27 18:13:43 +01:00
Matt T. Proud 6dcaa28806 Include LevelDB fixture generators for curator.
This will help reduce common boilerplate for our test process
with respect to LevelDB-related things.
2013-03-27 15:13:40 +01:00
Matt T. Proud b2e4c88b80 Wrap LevelDB iterator operations behind interface.
The LevelDB storage types return an interface type now that wraps
around the underlying iterator.  This both enhances testability but
improves upon, in my opinion, the interface design for the LevelDB
iterator.

Secondarily, the resource reaping behaviors for the LevelDB iterators
have been improved by dropping the externalized io.Closer object.

Finally, the iterator provisioning methods provide the option for
indicating whether one wants a snapshotted iterator or not.
2013-03-25 12:57:58 +01:00
Matt T. Proud f2a30cf20c Several important cleanups and deprecations.
EachFunc is deprecated.

Remove deprecated ``Pair`` and ``GetAll``.

These were originally used for forensic and the old gorest impl.
Nothing today in the user-facing path nor the tests uses them,
especially since the advent of the ForEach protocol in the
interface.
2013-03-25 08:38:21 +01:00
Matt T. Proud 8f6b55be71 Several interface cleanups.
- Kill Close in Persistent and document interface.
 - Extract batching behavior into interface.
 - Kill IteratorManager, which was used for unknown reasons.
2013-03-24 07:35:43 +01:00
Julius Volz f238b23b04 Set -leveldbFlushOnMutate to false by default. 2013-03-21 18:08:47 +01:00
Matt T. Proud d5380897c3 Cleanups and adds performance regression. 2013-03-21 18:06:51 +01:00
Matt T. Proud 41068c2e84 Checkpoint. 2013-03-21 18:06:51 +01:00
Julius Volz d67e4b9131 Address outstanding comments from PR/47 and other cleanups. 2013-02-07 11:38:01 +01:00
Julius Volz e23ac0adbd Implement bulk iteration/operation storage interface. 2013-02-06 17:05:23 +01:00
Matt T. Proud ec3e98b365 Include Snappy in Runtime.
Snappy should have been explicitly included in the runtime, for I
erroneously thought that LevelDB bundled this into its runtime as-is.
It turns out that this assumption is wrong, and I thought we had
Snappy compression support all-along.
2013-02-01 13:35:07 +01:00
Matt T. Proud 79ba248bbe Make LevelDB operating modes invocation-time conf.
Presently our use of LevelDB and its operating modes are hardcoded
into the storage stack.  This pull request decouples this and
re-exposes this through flags.  We can now perform benchmarking
and remedial tuning.
2013-01-27 20:28:37 +01:00
Matt T. Proud ea54751431 Update import paths to new location.
This repository moved from matttproud/prometheus to
prometheus/prometheus, and all import paths need to be updated.
2013-01-27 18:49:45 +01:00
Matt T. Proud 3ac5d48b1a Impl' storage i'faces and fix non-idiomatic warts.
This change includes implementation of most major storage layer
features, albeit some imperfect.  It also includes nascent telemetry
bindings, too.
2013-01-04 10:39:38 +01:00
Matt T. Proud 577acf4fe7 Exploding the storage infrastructure by contexts. 2012-12-09 16:27:12 +01:00
Matt T. Proud 15a6681651 Various cleanups.
Kill LevelDB watermarks due to redundancy.

General interface documentation has begun.

Creating custom types for the model to prevent errors down the
road.

Renaming of components for easier comprehension.

Exposition of interface in LevelDB.

Slew of simple refactorings.
2012-12-08 14:03:08 +01:00
Matt T. Proud c1f0d8aefd Levigo -> LevelDB in terminology and references. 2012-11-28 20:25:19 +01:00
Matt T. Proud 6ed67b02e2 Incorporate new interface tests. 2012-11-28 18:52:04 +01:00
Matt T. Proud 44f8802ae7 Add Apache License 2.0 boilerplate. 2012-11-26 20:11:34 +01:00
Matt T. Proud 2bbdaa5790 Initial directory re-arrangement for storage. 2012-11-26 19:56:51 +01:00