spotify / heroic

The Heroic Time Series Database
https://spotify.github.io/heroic/
Apache License 2.0
848 stars 109 forks source link

[WIP]Add distribution support to spotify100_proto and BigtableBackend writer #699

Closed ao2017 closed 4 years ago

ao2017 commented 4 years ago

This is the first of several PRs that will add distribution support to heroic. With Distribution support heroic will be able to provide histogram data based on data distribution. Distribution support will also enable Opencensus metric import. This PR implements Spotify100Proto consumer and BigtableBackend(ingestion). What is New:

  1. Spotify100 Proto Consumer: This PR introduces a new dataPoint type.

    @AutoValue
    public abstract class DistributionPoint implements Metric {
    
    public abstract long getTimestamp();
    public abstract Distribution value();
    
    public static DistributionPoint create(final Distribution value, final long timestamp) {
        return new AutoValue_DistributionPoint(timestamp, value);
    }
    
    @Override
    public boolean valid() {
        return value().getValue() != null &&  !value().getValue().isEmpty();
    }
    
    @Override
    public void hash(@NotNull Hasher hasher) {
        hasher.putInt(this.hashCode());
    }
    } 
  2. BigTableBackend This PR introduces a mechanism to insert DistributionPoint into Bigtable. The overall structure of the BigTableBackend does not change. But this PR introduces a new column family "DistributionPoint"

Referecence: https://github.com/spotify/heroic/issues/695

codecov[bot] commented 4 years ago

Codecov Report

Merging #699 into master will decrease coverage by 0.35%. The diff coverage is 81.25%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #699      +/-   ##
============================================
- Coverage     54.17%   53.82%   -0.36%     
+ Complexity     3020     2971      -49     
============================================
  Files           728      729       +1     
  Lines         19678    19551     -127     
  Branches       1288     1292       +4     
============================================
- Hits          10661    10523     -138     
- Misses         8564     8576      +12     
+ Partials        453      452       -1     
Impacted Files Coverage Δ Complexity Δ
...spotify/heroic/aggregation/AggregationSession.java 0.00% <0.00%> (ø) 0.00 <0.00> (?)
...a/com/spotify/heroic/metric/DistributionPoint.java 40.00% <40.00%> (ø) 2.00 <2.00> (?)
...va/com/spotify/heroic/metric/MetricCollection.java 54.90% <42.85%> (-1.92%) 10.00 <1.00> (+1.00) :arrow_down:
...potify/heroic/metric/bigtable/BigtableBackend.java 89.84% <66.66%> (-0.54%) 60.00 <1.00> (+1.00) :arrow_down:
...otify/heroic/consumer/schemas/Spotify100Proto.java 93.02% <95.12%> (+1.02%) 0.00 <0.00> (ø)
.../com/spotify/heroic/metric/HeroicDistribution.java 100.00% <100.00%> (ø) 2.00 <2.00> (?)
...ain/java/com/spotify/heroic/metric/MetricType.java 88.88% <100.00%> (+0.65%) 5.00 <0.00> (ø)
...src/main/java/com/spotify/heroic/metrics/EWMA.java 58.33% <0.00%> (-20.84%) 4.00% <0.00%> (-1.00%)
...rc/main/java/com/spotify/heroic/metrics/Meter.java 68.96% <0.00%> (-17.25%) 6.00% <0.00%> (-2.00%)
...com/spotify/heroic/aggregation/simple/MaxBucket.kt 44.44% <0.00%> (-11.12%) 4.00% <0.00%> (-1.00%)
... and 19 more

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 0222c51...bb4e298. Read the comment docs.