1 #ifndef PUBSEQ_GATEWAY_TIMING__HPP
2 #define PUBSEQ_GATEWAY_TIMING__HPP
123 const string & description,
140 m_PSGTiming->Add(mks);
141 m_AvgTimeSeries.Add(mks);
142 if (mks > m_MaxValue)
149 m_PSGTiming->Reset();
150 m_AvgTimeSeries.Reset();
156 m_PSGTiming->Rotate();
169 m_AvgTimeSeries.Rotate();
178 return m_PSGTiming->GetCurrentTick() + 1;
184 virtual CJsonNode SerializeCombined(
int most_ancient_time,
185 int most_recent_time,
186 unsigned long tick_span,
188 const string & description)
const;
189 virtual CJsonNode SerializeSeries(
int most_ancient_time,
190 int most_recent_time,
191 unsigned long tick_span,
193 const string & description)
const;
195 int most_ancient_time,
196 int most_recent_time,
198 size_t current_index)
200 return m_AvgTimeSeries.Serialize(time_series,
203 loop, current_index);
218 #define TIMING_CLASS(class_name) \
219 class class_name : public CPSGTimingBase \
222 class_name(unsigned long min_stat_value, \
223 unsigned long max_stat_value, \
224 unsigned long n_bins, \
225 TOnePSGTiming::EScaleType stat_type, \
226 bool & reset_to_default); \
298 unsigned long max_blob_size,
299 unsigned long min_stat_value,
300 unsigned long max_stat_value,
301 unsigned long n_bins,
303 bool & reset_to_default);
307 virtual CJsonNode SerializeCombined(
int most_ancient_time,
308 int most_recent_time,
309 unsigned long tick_span,
311 const string & description)
const;
312 virtual CJsonNode SerializeSeries(
int most_ancient_time,
313 int most_recent_time,
314 unsigned long tick_span,
316 const string & description)
const;
319 {
return m_MinBlobSize; }
322 {
return m_MaxBlobSize; }
335 unsigned long max_stat_value,
336 unsigned long n_bins,
337 const string & stat_type,
338 unsigned long small_blob_size,
339 const string & only_for_processor,
340 size_t log_timing_threshold,
361 void RotateRequestStat(
void);
362 void RotateAvgPerfTimeSeries(
void);
363 void CollectMomentousStat(
size_t tcp_conn_count,
364 size_t active_request_count,
365 size_t backlog_count);
368 int most_recent_time,
369 const vector<CTempString> & histogram_names,
370 const vector<pair<int, int>> & time_series,
371 unsigned long tick_span)
const;
374 bool x_SetupBlobSizeBins(
unsigned long min_stat_value,
375 unsigned long max_stat_value,
376 unsigned long n_bins,
378 unsigned long small_blob_size);
379 ssize_t x_GetBlobRetrievalBinIndex(
unsigned long blob_size);
380 void x_UpdateMaxReqsStat(
size_t index,
457 const string & name,
const string & description) :
458 m_Timing(timing), m_Name(name), m_Description(description),
463 const string & name,
const string & description,
465 const string & counter_id,
466 const string & counter_name,
467 const string & counter_description) :
468 m_Timing(timing), m_Name(name), m_Description(description),
470 m_CounterId(counter_id),
471 m_CounterName(counter_name),
472 m_CounterDescription(counter_description)
unsigned long GetMaxBlobSize(void) const
unsigned long m_MinBlobSize
unsigned long m_MaxBlobSize
unsigned long GetMinBlobSize(void) const
A series of same-structured histograms covering logarithmically (base 2) increasing time periods....
CHistogram – collect the distribution of the numerical data samples.
CMomentousCounterSeries m_BacklogStat
CMomentousCounterSeries m_TCPConnectionsStat
unique_ptr< CMyNCBITiming > m_RetrieveMyNCBIErrorTiming
vector< unique_ptr< CResolutionTiming > > m_ResolutionFoundTiming
vector< vector< unique_ptr< CBlobRetrieveTiming > > > m_BlobRetrieveTiming
vector< vector< unique_ptr< CProcessorPerformanceTiming > > > m_NotFoundProcPerformance
vector< vector< uint64_t > > m_BlobByteCounters
CRequestTimeSeries m_IdGetblobStat
vector< unique_ptr< CWGSVDBLookupTiming > > m_WGSVDBLookupTiming
vector< unique_ptr< CAccVerHistoryRetrieveTiming > > m_AccVerHistoryRetrieveTiming
vector< unique_ptr< CProcessorRequestTimeSeries > > m_IdGetDoneByProc
vector< vector< unique_ptr< CNAResolveTiming > > > m_NAResolveTiming
CRequestTimeSeries m_IpgResolveStat
vector< unique_ptr< CResolutionTiming > > m_ResolutionNotFoundTiming
vector< unique_ptr< CCassTiming > > m_LookupCassBioseqInfoTiming
vector< unique_ptr< CResolutionTiming > > m_ResolutionErrorTiming
CMonotonicCounterSeries m_ErrorTimeSeries
vector< unique_ptr< CMyNCBITiming > > m_RetrieveMyNCBITiming
CRequestTimeSeries m_IdGetTSEChunkStat
size_t m_LogTimingThresholdMks
unique_ptr< CBacklogTiming > m_BacklogTiming
vector< unique_ptr< CLmdbCacheTiming > > m_LookupLmdbBioseqInfoTiming
vector< unique_ptr< CResolutionTiming > > m_ResolutionFoundCassandraTiming
CRequestTimeSeries m_IdGetNAStat
vector< unique_ptr< CSNPPTISLookupTiming > > m_SNPPTISLookupTiming
vector< unique_ptr< CVDBOpenTiming > > m_VDBOpenTiming
map< string, SInfo > m_NamesMap
vector< unique_ptr< CHugeBlobRetrieveTiming > > m_HugeBlobRetrievalTiming
vector< unique_ptr< CSplitHistoryRetrieveTiming > > m_SplitHistoryRetrieveTiming
vector< unique_ptr< CNotFoundBlobRetrieveTiming > > m_NotFoundBlobRetrievalTiming
vector< vector< unique_ptr< CNARetrieveTiming > > > m_NARetrieveTiming
vector< unique_ptr< CLmdbCacheTiming > > m_LookupLmdbSi2csiTiming
vector< unique_ptr< CProcessorRequestTimeSeries > > m_IdGetNADoneByProc
vector< unique_ptr< CPublicCommentRetrieveTiming > > m_PublicCommentRetrieveTiming
vector< unique_ptr< CCassResolutionTiming > > m_ResolutionCassTiming
CRequestTimeSeries m_IdAccVerHistStat
CRequestTimeSeries m_IdResolveStat
map< string, size_t > m_ProcGroupToIndex
vector< vector< unique_ptr< CTSEChunkRetrieveTiming > > > m_TSEChunkRetrieveTiming
vector< unsigned long > m_Ends
vector< unique_ptr< CLmdbResolutionTiming > > m_ResolutionLmdbTiming
vector< unique_ptr< CProcessorRequestTimeSeries > > m_IdGetTSEChunkDoneByProc
string m_OnlyForProcessor
vector< unique_ptr< CIPGResolveRetrieveTiming > > m_IPGResolveRetrieveTiming
vector< unique_ptr< CCassTiming > > m_LookupCassBlobPropTiming
vector< unique_ptr< CCassTiming > > m_LookupCassSi2csiTiming
vector< unique_ptr< CLmdbCacheTiming > > m_LookupLmdbBlobPropTiming
vector< vector< unique_ptr< CProcessorPerformanceTiming > > > m_ErrorProcPerformance
vector< unique_ptr< CProcessorRequestTimeSeries > > m_IdGetblobDoneByProc
vector< vector< unique_ptr< CProcessorPerformanceTiming > > > m_DoneProcPerformance
CMomentousCounterSeries m_ActiveRequestsStat
vector< unique_ptr< CProcessorRequestTimeSeries > > m_IdResolveDoneByProc
CRequestTimeSeries m_IdGetStat
vector< vector< unique_ptr< CProcessorPerformanceTiming > > > m_TimeoutProcPerformance
vector< uint64_t > m_HugeBlobByteCounter
unique_ptr< TPSGTiming > m_PSGTiming
CAvgPerformanceSeries m_AvgTimeSeries
virtual ~CPSGTimingBase()
CJsonNode SerializeAvgPerfSeries(const vector< pair< int, int >> &time_series, int most_ancient_time, int most_recent_time, bool loop, size_t current_index)
uint64_t GetMaxValue(void) const
TPSGTiming::TTicks GetNumberOfCoveredTicks(void) const
void RotateAvgTimeSeries(void)
Interface class (and self-factory) for request processor objects that can retrieve data from a given ...
EPSGS_Status
The GetStatus() method returns a processor current status.
Frequency histogram for data distribution of the numerical samples.
unsigned int TTicks
Type of the unit of time.
psg_clock_t::time_point psg_time_point_t
SInfo(CPSGTimingBase *timing, const string &name, const string &description, uint64_t *counter, const string &counter_id, const string &counter_name, const string &counter_description)
SInfo & operator=(SInfo &&)=default
SInfo(CPSGTimingBase *timing, const string &name, const string &description)
string m_CounterDescription
SInfo(const SInfo &)=default
CPSGTimingBase * m_Timing
SInfo & operator=(const SInfo &)=default
const unsigned long kNStatBins
const unsigned long kMinStatValue
#define TIMING_CLASS(class_name)
const string kStatScaleType
@ eResolutionFoundInCassandra
const unsigned long kMaxStatValue
const unsigned long kTickSpan
CHistogram< uint64_t, uint64_t, uint64_t > TOnePSGTiming
CJsonNode SerializeHistogram(const TOnePSGTiming &histogram, const string &name, const string &description, uint64_t max_value)
CHistogramTimeSeries< uint64_t, uint64_t, uint64_t > TPSGTiming
void Serialize(CNcbiOstream &, const CRawScoreVector< Key, Score > &)
Generics These throw an exception; we must implement serialization for each type.