< prev index next >

src/hotspot/share/gc/z/zStat.cpp

Print this page




  53     _max(0) {}
  54 
  55   void add(const ZStatSamplerData& new_sample) {
  56     _nsamples += new_sample._nsamples;
  57     _sum += new_sample._nsamples;
  58     _max = MAX2(_max, new_sample._max);
  59   }
  60 };
  61 
  62 struct ZStatCounterData {
  63   uint64_t _counter;
  64 
  65   ZStatCounterData() :
  66     _counter(0) {}
  67 };
  68 
  69 //
  70 // Stat sampler history
  71 //
  72 template <size_t size>
  73 class ZStatSamplerHistoryInterval VALUE_OBJ_CLASS_SPEC {
  74 private:
  75   size_t           _next;
  76   ZStatSamplerData _samples[size];
  77   ZStatSamplerData _accumulated;
  78   ZStatSamplerData _total;
  79 
  80 public:
  81   ZStatSamplerHistoryInterval() :
  82       _next(0),
  83       _samples(),
  84       _total(),
  85       _accumulated() {}
  86 
  87   bool add(const ZStatSamplerData& new_sample) {
  88     // Insert sample
  89     const ZStatSamplerData old_sample = _samples[_next];
  90     _samples[_next] = new_sample;
  91 
  92     // Adjust accumulated
  93     _accumulated._nsamples += new_sample._nsamples;




  53     _max(0) {}
  54 
  55   void add(const ZStatSamplerData& new_sample) {
  56     _nsamples += new_sample._nsamples;
  57     _sum += new_sample._nsamples;
  58     _max = MAX2(_max, new_sample._max);
  59   }
  60 };
  61 
  62 struct ZStatCounterData {
  63   uint64_t _counter;
  64 
  65   ZStatCounterData() :
  66     _counter(0) {}
  67 };
  68 
  69 //
  70 // Stat sampler history
  71 //
  72 template <size_t size>
  73 class ZStatSamplerHistoryInterval {
  74 private:
  75   size_t           _next;
  76   ZStatSamplerData _samples[size];
  77   ZStatSamplerData _accumulated;
  78   ZStatSamplerData _total;
  79 
  80 public:
  81   ZStatSamplerHistoryInterval() :
  82       _next(0),
  83       _samples(),
  84       _total(),
  85       _accumulated() {}
  86 
  87   bool add(const ZStatSamplerData& new_sample) {
  88     // Insert sample
  89     const ZStatSamplerData old_sample = _samples[_next];
  90     _samples[_next] = new_sample;
  91 
  92     // Adjust accumulated
  93     _accumulated._nsamples += new_sample._nsamples;


< prev index next >