opencensus-cpp-harvest-interval.patch 1.3 KB

123456789101112131415161718192021222324252627282930313233343536
  1. diff --git a/opencensus/stats/internal/delta_producer.cc b/opencensus/stats/internal/delta_producer.cc
  2. index c61b4d9..1d00504 100644
  3. --- a/opencensus/stats/internal/delta_producer.cc
  4. +++ b/opencensus/stats/internal/delta_producer.cc
  5. @@ -139,5 +139,9 @@ void DeltaProducer::RunHarvesterLoop() {
  6. }
  7. }
  8. +void DeltaProducer::SetHarvestInterval(const absl::Duration interval) {
  9. + harvest_interval_ = interval;
  10. +}
  11. +
  12. } // namespace stats
  13. } // namespace opencensus
  14. diff --git a/opencensus/stats/internal/delta_producer.h b/opencensus/stats/internal/delta_producer.h
  15. index bec5605..e565f6a 100644
  16. --- a/opencensus/stats/internal/delta_producer.h
  17. +++ b/opencensus/stats/internal/delta_producer.h
  18. @@ -84,6 +84,8 @@ class DeltaProducer final {
  19. // Flushes the active delta and blocks until it is harvested.
  20. void Flush() ABSL_LOCKS_EXCLUDED(delta_mu_, harvester_mu_);
  21. + void SetHarvestInterval(const absl::Duration interval);
  22. +
  23. private:
  24. DeltaProducer();
  25. @@ -100,7 +102,7 @@ class DeltaProducer final {
  26. // every harvest_interval_.
  27. void RunHarvesterLoop();
  28. - const absl::Duration harvest_interval_ = absl::Seconds(5);
  29. + absl::Duration harvest_interval_ = absl::Seconds(5);
  30. // Guards the active delta and its configuration. Anything that changes the
  31. // delta configuration (e.g. adding a measure or BucketBoundaries) must