opencensus-cpp-harvest-interval.patch 1.2 KB

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