(
"End");
60 const string& description,
71 size_tlast_bin_index = bin_count - 1;
74 for(
size_tk = 0; k < bin_count; ++k) {
77 if(k >= last_bin_index)
93lower_anomalies + upper_anomalies);
102 intmost_recent_time,
103 unsigned longtick_span,
105 const string& description)
const 110 int64_thistogram_start_time = 0;
112 for(
auto& bin : bins) {
113 int64_thistogram_cover = tick_span * bin.n_ticks;
114 int64_thistogram_end_time = histogram_start_time + histogram_cover - 1;
116 if(most_recent_time >= 0) {
118 if(most_recent_time > histogram_end_time) {
120histogram_start_time = histogram_end_time + 1;
125 if(most_ancient_time >= 0) {
127 if(most_ancient_time < histogram_start_time) {
129histogram_start_time = histogram_end_time + 1;
141histogram_start_time = histogram_end_time + 1;
149 intmost_recent_time,
150 unsigned longtick_span,
152 const string& description)
const 158 int64_thistogram_start_time = 0;
159 int64_tactual_recent_time = -1;
160 int64_tactual_ancient_time = -1;
162 for(
auto& bin : bins) {
163 int64_thistogram_cover = tick_span * bin.n_ticks;
164 int64_thistogram_end_time = histogram_start_time + histogram_cover - 1;
166 if(most_recent_time >= 0) {
168 if(most_recent_time > histogram_end_time) {
170histogram_start_time = histogram_end_time + 1;
175 if(most_ancient_time >= 0) {
177 if(most_ancient_time < histogram_start_time) {
179histogram_start_time = histogram_end_time + 1;
188 if(actual_recent_time == -1)
189actual_recent_time = histogram_start_time;
190actual_ancient_time = histogram_end_time;
192histogram_start_time = histogram_end_time + 1;
196 if(actual_recent_time == -1 && actual_ancient_time == -1) {
209 #define TIMING_CLASS_DEF(class_name) \ 210 class_name::class_name(unsigned long min_stat_value, \ 211 unsigned long max_stat_value, \ 212 unsigned long n_bins, \ 213 TOnePSGTiming::EScaleType stat_type, \ 214 bool & reset_to_default) \ 216 reset_to_default = false; \ 218 TOnePSGTiming model_histogram(min_stat_value, max_stat_value, \ 219 n_bins, stat_type); \ 220 m_PSGTiming.reset(new TPSGTiming(model_histogram)); \ 222 reset_to_default = true; \ 223 TOnePSGTiming model_histogram(kMinStatValue, \ 226 TOnePSGTiming::eLog2); \ 227 m_PSGTiming.reset(new TPSGTiming(model_histogram)); \ 254 size_tmax_blob_size,
255 unsigned longmin_stat_value,
256 unsigned longmax_stat_value,
257 unsigned longn_bins,
259 bool& reset_to_default) :
260m_MinBlobSize(min_blob_size), m_MaxBlobSize(max_blob_size)
262reset_to_default =
false;
265 TOnePSGTimingmodel_histogram(min_stat_value, max_stat_value,
269reset_to_default =
true;
283 intmost_recent_time,
284 unsigned longtick_span,
286 const string& description)
const 300 intmost_recent_time,
301 unsigned longtick_span,
303 const string& description)
const 318 unsigned longmax_stat_value,
319 unsigned longn_bins,
320 const string& stat_type,
321 unsigned longsmall_blob_size,
322 const string& only_for_processor,
323 size_tlog_timing_threshold,
325m_OnlyForProcessor(only_for_processor),
326m_LogTimingThresholdMks(log_timing_threshold * 1000),
327m_ProcGroupToIndex(proc_group_to_index)
333 boolreset_to_default =
false;
334 for(
size_tindex = 0; index <= 1; ++index) {
336unique_ptr<CLmdbCacheTiming>(
338n_bins, scale_type, reset_to_default)));
340unique_ptr<CLmdbCacheTiming>(
342n_bins, scale_type, reset_to_default)));
344unique_ptr<CLmdbCacheTiming>(
346n_bins, scale_type, reset_to_default)));
348unique_ptr<CCassTiming>(
350n_bins, scale_type, reset_to_default)));
352unique_ptr<CCassTiming>(
354n_bins, scale_type, reset_to_default)));
356unique_ptr<CCassTiming>(
358n_bins, scale_type, reset_to_default)));
360unique_ptr<CMyNCBITiming>(
362n_bins, scale_type, reset_to_default)));
365unique_ptr<CLmdbResolutionTiming>(
367n_bins, scale_type, reset_to_default)));
369unique_ptr<CCassResolutionTiming>(
371n_bins, scale_type, reset_to_default)));
374unique_ptr<CSplitHistoryRetrieveTiming>(
376n_bins, scale_type, reset_to_default)));
379unique_ptr<CPublicCommentRetrieveTiming>(
381n_bins, scale_type, reset_to_default)));
384unique_ptr<CAccVerHistoryRetrieveTiming>(
386n_bins, scale_type, reset_to_default)));
389unique_ptr<CIPGResolveRetrieveTiming>(
391n_bins, scale_type, reset_to_default)));
394unique_ptr<CVDBOpenTiming>(
396n_bins, scale_type, reset_to_default)));
399unique_ptr<CSNPPTISLookupTiming>(
401n_bins, scale_type, reset_to_default)));
404unique_ptr<CWGSVDBLookupTiming>(
406n_bins, scale_type, reset_to_default)));
412n_bins, scale_type, reset_to_default));
416n_bins, scale_type, reset_to_default));
420 for(
size_tindex = 0; index < 5; ++index) {
422unique_ptr<CResolutionTiming>(
424n_bins, scale_type, reset_to_default)));
434n_bins, scale_type, small_blob_size);
437 for(
size_treq_index = 0;
448unique_ptr<CProcessorPerformanceTiming>(
450n_bins, scale_type, reset_to_default)));
452unique_ptr<CProcessorPerformanceTiming>(
454n_bins, scale_type, reset_to_default)));
456unique_ptr<CProcessorPerformanceTiming>(
458n_bins, scale_type, reset_to_default)));
460unique_ptr<CProcessorPerformanceTiming>(
462n_bins, scale_type, reset_to_default)));
467 if(reset_to_default)
468 PSG_ERROR(
"Invalid statistics parameters detected. Default parameters " 473{
"LookupLmdbSi2csiFound",
475 "si2csi LMDB cache found",
476 "The timing of si2csi LMDB cache lookup " 477 "when a record was found" 480{
"LookupLmdbSi2csiNotFound",
482 "si2csi LMDB cache not found",
483 "The timing of si2csi LMDB cache lookup " 484 "when there was no record found" 487{
"LookupLmdbBioseqInfoFound",
489 "bioseq info LMDB cache found",
490 "The timing of bioseq info LMDB cache lookup " 491 "when a record was found" 494{
"LookupLmdbBioseqInfoNotFound",
496 "bioseq info LMDB cache not found",
497 "The timing of bioseq info LMDB cache lookup " 498 "when there was no record found" 501{
"LookupLmdbBlobPropFound",
503 "blob properties LMDB cache found",
504 "The timing of blob properties LMDB cache lookup " 505 "when a record was found" 508{
"LookupLmdbBlobPropNotFound",
510 "blob properties LMDB cache not found",
511 "The timing of blob properties LMDB cache lookup " 512 "when there was no record found" 515{
"LookupCassSi2csiFound",
517 "si2csi Cassandra found",
518 "The timing of si2csi Cassandra lookup " 519 "when a record was found" 522{
"LookupCassSi2csiNotFound",
524 "si2csi Cassandra not found",
525 "The timing of si2csi Cassandra lookup " 526 "when there was no record found" 529{
"LookupCassBioseqInfoFound",
531 "bioseq info Cassandra found",
532 "The timing of bioseq info Cassandra lookup " 533 "when a record was found" 536{
"LookupCassBioseqInfoNotFound",
538 "bioseq info Cassandra not found",
539 "The timing of bioseq info Cassandra lookup " 540 "when there was no record found" 543{
"LookupCassBlobPropFound",
545 "blob properties Cassandra found",
546 "The timing of blob properties Cassandra lookup " 547 "when a record was found" 550{
"LookupCassBlobPropNotFound",
552 "blob properties Cassandra not found",
553 "The timing of blob properties Cassandra lookup " 554 "when there was no record found" 557{
"RetrieveMyNCBIFound",
559 "retrieve MyNCBI found",
560 "The timing of the retrieve data from MyNCBI when a record " 564{
"RetrieveMyNCBIError",
566 "MyNCBI retrieve timing in case of errors",
567 "The time MyNCBI replied within when there was an error" 570{
"RetrieveMyNCBINotFound",
572 "retrieve MyNCBI not found",
573 "The timing of the retrieve data from MyNCBI when there was no " 577{
"ResolutionLmdbFound",
579 "LMDB resolution succeeded",
580 "The timing of a seq id successful resolution " 581 "in LMDB cache (start: request is received)" 584{
"ResolutionLmdbNotFound",
586 "LMDB resolution not found",
587 "The timing of a seq id unsuccessful resolution " 588 "when all the tries in LMDB cache led to nothing " 589 "(start: request is received)" 592{
"ResolutionCassFound",
594 "CassandraDB resolution succeeded",
595 "The timing of a seq id successful resolution " 596 "in Cassandra regardless how many queries were " 597 "made to Cassandra (start: first Cassandra query)" 600{
"ResolutionCassNotFound",
602 "CassandraDB resolution not found",
603 "The timing of a seq id unsuccessful resolution " 604 "when all the tries in Cassandra led to nothing " 605 "start: first Cassandra query)" 608{
"SplitHistoryRetrieveFound",
610 "Split history found",
611 "The timing of split history successful retrieval" 614{
"SplitHistoryRetrieveNotFound",
616 "Split history not found",
617 "The timing of split history retrieval " 618 "when nothing was found" 621{
"PublicCommentRetrieveFound",
623 "Public comment found",
624 "The timing of a public comment successful retrieval" 627{
"PublicCommentRetrieveNotFound",
629 "Public comment not found",
630 "The timing of a public comment retrieval " 631 "when nothing was found" 634{
"AccessionVersionHistoryRetrieveFound",
636 "Accession version history found",
637 "The timing of an accession version history successful retrieval" 640{
"AccessionVersionHistoryRetrieveNotFound",
642 "Accession version history not found",
643 "The timing of an accession version history retrieval " 644 "when nothing was found" 647{
"IPGResolveRetrieveFound",
649 "IPG resolve found",
650 "The timing of an ipg successful retrieval" 653{
"IPGResolveRetrieveNotFound",
655 "IPG resolve not found",
656 "The timing of an ipg resolve retrieval " 657 "when nothing was found" 662 "VDB opening success",
663 "The timing of the successful VDB opening" 668 "VDB opening failure",
669 "The timing of the failed VDB opening" 672{
"SNPPTISLookupFound",
674 "SNP PTIS lookup found",
675 "The timing of the SNP PTIS lookup success" 678{
"SNPPTISLookupNotFound",
680 "SNP PTIS lookup not found",
681 "The timing of the SNP PTIS lookup when nothing was found" 684{
"WGSVDBLookupFound",
686 "WGS VDB lookup found",
687 "The timing of the WGS VDB lookup success" 690{
"WGSVDBLookupNotFound",
692 "WGS VDB lookup not found",
693 "The timing of the WGS VDB lookup when nothing was found" 699 "The time a request spent in a backlog before processing" 702{
"ResolutionFoundCassandraIn1Try",
704 "Resolution succeeded via Cassandra (1 try)",
705 "The timing of a seq id resolution in Cassandra when " 706 "1 try was required (start: first Cassandra query)" 709{
"ResolutionFoundCassandraIn2Tries",
711 "Resolution succeeded via Cassandra (2 tries)",
712 "The timing of a seq id resolution in Cassandra when " 713 "2 tries were required (start: first Cassandra query)" 716{
"ResolutionFoundCassandraIn3Tries",
718 "Resolution succeeded via Cassandra (3 tries)",
719 "The timing of a seq id resolution in Cassandra when " 720 "3 tries were required (start: first Cassandra query)" 723{
"ResolutionFoundCassandraIn4Tries",
725 "Resolution succeeded via Cassandra (4 tries)",
726 "The timing of a seq id resolution in Cassandra when " 727 "4 tries were required (start: first Cassandra query)" 730{
"ResolutionFoundCassandraIn5OrMoreTries",
732 "Resolution succeeded via Cassandra (5 tries or more)",
733 "The timing of a seq id resolution in Cassandra when " 734 "5 or more tries were required (start: first Cassandra query)" 742proc_group_names[item.second] = item.first;
745 for(
size_treq_index = 0;
750 size_tproc_index = item.second;
753 stringprefix = item.first +
"_"+
755 stringsuffix =
"_ProcessorPerformance";
759item.first +
" Done performance for "+ req_name,
760 "The timing of the "+ item.first +
761 " processor when it finished with status Done for "+ req_name);
765item.first +
" NotFound performance for "+ req_name,
766 "The timing of the "+ item.first +
767 " processor when it finished with status NotFound for "+ req_name);
771item.first +
" Timeout performance for "+ req_name,
772 "The timing of the "+ item.first +
773 " processor when it finished with status Timeout for "+ req_name);
777item.first +
" Error performance for "+ req_name,
778 "The timing of the "+ item.first +
779 " processor when it finished with status Error for "+ req_name);
783 for(
const auto& proc_group : proc_group_names) {
784 string id= proc_group +
"ResolutionError";
786unique_ptr<CResolutionTiming>(
788n_bins, scale_type, reset_to_default)));
791proc_group +
" resolution error",
792 "The timing of a case when an error was detected while " 793 "resolving seq id (by "+ proc_group +
794 ") regardless of the resolution path " 795 "(start: request is received)");
797 id= proc_group +
"ResolutionNotFound";
799unique_ptr<CResolutionTiming>(
801n_bins, scale_type, reset_to_default)));
803proc_group +
" resolution not found",
804 "The timing of a case when resolution of a seq id did not succeed " 805 "(by "+ proc_group +
") regardless of the resolution path " 806 "(start: request is received)");
808 id= proc_group +
"ResolutionFound";
810unique_ptr<CResolutionTiming>(
812n_bins, scale_type, reset_to_default)));
814proc_group +
" resolution succeeded",
815 "The timing of a seq id successful resolution (by "+
816proc_group +
") regardless of the resolution path " 817 "(start: request is received)");
821unique_ptr<CNARetrieveTiming>(
823n_bins, scale_type, reset_to_default)));
824 id= proc_group +
"NARetrieveFound";
826proc_group +
" named annotations found",
827 "The timing of named annotations successful retrieval (by "+
830 id= proc_group +
"NARetrieveNotFound";
832unique_ptr<CNARetrieveTiming>(
834n_bins, scale_type, reset_to_default)));
836proc_group +
" named annotations not found",
837 "The timing of named annotations retrieval " 838 "when nothing was found (by "+ proc_group +
")");
842unique_ptr<CTSEChunkRetrieveTiming>(
844n_bins, scale_type, reset_to_default)));
845 id= proc_group +
"TSEChunkRetrieveFound";
847proc_group +
" TSE chunk found",
848 "The timing of a TSE chunk retrieval (by "+ proc_group +
")");
851unique_ptr<CTSEChunkRetrieveTiming>(
853n_bins, scale_type, reset_to_default)));
854 id= proc_group +
"TSEChunkRetrieveNotFound";
856proc_group +
" TSE chunk not found",
857 "The timing of a TSE chunk retrieval " 858 "when nothing was found (by "+ proc_group +
")");
862unique_ptr<CNAResolveTiming>(
864n_bins, scale_type, reset_to_default)));
865 id= proc_group +
"NAResolveFound";
868 if(proc_group ==
"CDD"|| proc_group ==
"SNP") {
870proc_group +
" NA resolution found",
871 "The timing of the NA resolution (by "+ proc_group +
")");
873 m_NamesMap[id] =
SInfo(
nullptr,
"uninitialized",
"uninitialized");
877unique_ptr<CNAResolveTiming>(
879n_bins, scale_type, reset_to_default)));
880 id= proc_group +
"NAResolveNotFound";
883 if(proc_group ==
"CDD"|| proc_group ==
"SNP") {
885proc_group +
" NA resolution not found",
886 "The timing of the NA resolution " 887 "when nothing was found (by "+ proc_group +
")");
889 m_NamesMap[id] =
SInfo(
nullptr,
"uninitialized",
"uninitialized");
893unique_ptr<CHugeBlobRetrieveTiming>(
895n_bins, scale_type, reset_to_default)));
896 id= proc_group +
"HugeBlobRetrieval";
898proc_group +
" huge blob retrieval",
899 "The timing of the very large blob retrieval",
901proc_group +
"HugeBlobByteCounter",
902proc_group +
" huge blob bytes counter",
903 "The number of bytes transferred to the user as very large blobs by "+ proc_group
907unique_ptr<CNotFoundBlobRetrieveTiming>(
909n_bins, scale_type, reset_to_default)));
910 id= proc_group +
"BlobRetrievalNotFound";
912proc_group +
" blob retrieval not found",
913 "The timing of blob retrieval when a blob was not found by "+ proc_group);
917 stringmin_size_str = to_string(retieve_timing->GetMinBlobSize());
918 stringmax_size_str = to_string(retieve_timing->GetMaxBlobSize());
919 string id= proc_group +
"BlobRetrievalFrom"+ min_size_str +
"To"+ max_size_str;
920 stringname = proc_group +
" Blob retrieval (size: "+
921min_size_str +
" to "+ max_size_str +
")";
922 stringdescription =
"The timing of a blob retrieval when " 923 "the blob size is between "+ min_size_str +
924 " and "+ max_size_str +
" bytes";
926 stringcounter_id = proc_group +
"BlobByteCounterFrom"+ min_size_str +
928 stringcounter_name =
"Blob byte counter (blob size: "+
929min_size_str +
" to "+ max_size_str +
") by "+ proc_group;
930 stringcounter_description =
"The number of bytes transferred to " 931 "the user as blobs size between "+
932min_size_str +
" and "+
933max_size_str +
" by "+ proc_group;
936counter_id, counter_name, counter_description);
952 autoid_to_name_and_desc = app->Settings().m_IdToNameAndDescription;
954 for(
const auto& item : id_to_name_and_desc) {
956 m_NamesMap[item.first].m_Name = get<0>(item.second);
957 m_NamesMap[item.first].m_Description = get<1>(item.second);
962 if(
info.second.m_CounterId == item.first) {
963 info.second.m_CounterName = get<0>(item.second);
964 info.second.m_CounterDescription = get<1>(item.second);
1003 unsigned longmax_stat_value,
1004 unsigned longn_bins,
1006 unsigned longsmall_blob_size)
1008 boolreset_to_default =
false;
1012unique_ptr<CBlobRetrieveTiming>(
1014min_stat_value, max_stat_value,
1016reset_to_default)));
1020 m_Ends.push_back(small_blob_size);
1022 unsigned longrange_end = small_blob_size;
1023 unsigned longrange_start = range_end + 1;
1027range_end = (size_t(1) << k) - 1;
1028 if(range_end <= small_blob_size) {
1034unique_ptr<CBlobRetrieveTiming>(
1036min_stat_value, max_stat_value,
1038reset_to_default)));
1042 m_Ends.push_back(range_end);
1044range_start = range_end + 1;
1051 returnreset_to_default;
1060 for(
size_tindex = 0; ; ++index) {
1061 if(
m_Ends[index] >= blob_size)
1072 unsigned longblob_size)
1076 if(processor !=
nullptr) {
1085 autonow = psg_clock_t::now();
1086 uint64_tmks = chrono::duration_cast<chrono::microseconds>(now - op_begin_ts).count();
1130 if(bin_index < 0) {
1139 PSG_ERROR(
"No processor for per processor timing ("+
1147 PSG_ERROR(
"No processor for per processor timing ("+
1148to_string(
eNARetrieve) +
"). Ignore and continue.");
1166 PSG_ERROR(
"No processor for per processor timing ("+
1173 PSG_ERROR(
"No processor for per processor timing ("+
1180 PSG_ERROR(
"No processor for per processor timing ("+
1188index = blob_size - 1;
1197 PSG_ERROR(
"No processor for per processor timing ("+
1203 if(group_name ==
"CDD"|| group_name ==
"SNP") {
1206 PSG_ERROR(
"NA resolve timing is supported for " 1207 "CDD and SNP only. Received from: "+ group_name);
1210 PSG_ERROR(
"No processor for per processor timing ("+
1211to_string(
eNAResolve) +
"). Ignore and continue.");
1234 if(processor !=
nullptr) {
1236app->GetCounters().Increment(processor,
1242request->SetRequestContext();
1274 switch(request_type) {
1305 switch(request_type) {
1342 size_trequest_index =
static_cast<size_t>(processor->
GetRequest()->GetRequestType());
1346 autonow = psg_clock_t::now();
1347 uint64_tmks = chrono::duration_cast<chrono::microseconds>(now - start_timestamp).count();
1349 switch(proc_finish_status) {
1380lock_guard<mutex> guard(
m_Lock);
1382 for(
size_tk = 0; k <= 1; ++k) {
1446 for(
size_treq_index = 0;
1490lock_guard<mutex> guard(
m_Lock);
1492 for(
size_tk = 0; k <= 1; ++k) {
1530item->RotateAvgTimeSeries();
1533item->RotateAvgTimeSeries();
1536item->RotateAvgTimeSeries();
1539item->RotateAvgTimeSeries();
1542item->RotateAvgTimeSeries();
1548item->RotateAvgTimeSeries();
1552item->RotateAvgTimeSeries();
1556 for(
size_treq_index = 0;
1570 size_tactive_request_count,
1571 size_tbacklog_count)
1584lock_guard<mutex> guard(
m_Lock);
1586 for(
size_tk = 0; k <= 1; ++k) {
1684 for(
size_treq_index = 0;
1701 intmost_recent_time,
1702 constvector<CTempString> & histogram_names,
1703 constvector<pair<int, int>> & time_series,
1704 unsigned longtick_span)
const 1712 size_tcurrent_index;
1719 if(histogram_names.empty()) {
1722lock_guard<mutex> guard(
m_Lock);
1724 for(
const auto& name_to_histogram :
m_NamesMap) {
1725 if(name_to_histogram.second.m_Timing ==
nullptr) {
1730ret.
SetByKey(name_to_histogram.first,
1731name_to_histogram.second.m_Timing->SerializeCombined(
1735name_to_histogram.second.m_Name,
1736name_to_histogram.second.m_Description));
1737 if(name_to_histogram.second.m_Counter !=
nullptr) {
1740name_to_histogram.second.m_CounterName);
1741bytes_counter.
SetString(
"description",
1742name_to_histogram.second.m_CounterDescription);
1744*name_to_histogram.second.m_Counter);
1745ret.
SetByKey(name_to_histogram.second.m_CounterId,
1749 if(!time_series.empty()) {
1751name_to_histogram.first +
"_AvgTimeSeries",
1752name_to_histogram.second.m_Timing->SerializeAvgPerfSeries(
1756loop, current_index));
1763 if(!time_series.empty()) {
1764ret.
SetByKey(
"ID_get_time_series",
1768loop, current_index));
1769ret.
SetByKey(
"ID_getblob_time_series",
1773loop, current_index));
1774ret.
SetByKey(
"ID_resolve_time_series",
1778loop, current_index));
1779ret.
SetByKey(
"ID_acc_ver_hist_time_series",
1783loop, current_index));
1784ret.
SetByKey(
"ID_get_tse_chunk_time_series",
1788loop, current_index));
1789ret.
SetByKey(
"ID_get_na_time_series",
1793loop, current_index));
1794ret.
SetByKey(
"IPG_resolve_time_series",
1798loop, current_index));
1800 boolmomentous_cnt_loop;
1801 size_tmomentous_cnt_current_index;
1803ret.
SetByKey(
"TCP_connections_time_series",
1808momentous_cnt_current_index));
1809ret.
SetByKey(
"active_requests_time_series",
1814momentous_cnt_current_index));
1815ret.
SetByKey(
"backlog_time_series",
1820momentous_cnt_current_index));
1827 if(current_index == 0) {
1831raw_index = current_index - 1;
1840max_warnings, max_not_found);
1848 while(raw_index > current_index + 1) {
1850max_warnings, max_not_found);
1857ret.
SetDouble(
"MaxPerSec_Requests", max_requests / 60.0);
1858ret.
SetDouble(
"MaxPerSec_Errors", max_errors / 60.0);
1859ret.
SetDouble(
"MaxPerSec_Warnings", max_warnings / 60.0);
1860ret.
SetDouble(
"MaxPerSec_NotFound", max_not_found / 60.0);
1865ret.
SetByKey(item.first +
"_ID_get_time_series",
1869loop, current_index));
1870ret.
SetByKey(item.first +
"_ID_getblob_time_series",
1874loop, current_index));
1875ret.
SetByKey(item.first +
"_ID_resolve_time_series",
1879loop, current_index));
1880ret.
SetByKey(item.first +
"_ID_get_tse_chunk_time_series",
1884loop, current_index));
1885ret.
SetByKey(item.first +
"_ID_get_na_time_series",
1889loop, current_index));
1891ret.
SetByKey(
"error_time_series",
1895loop, current_index));
1898lock_guard<mutex> guard(
m_Lock);
1900 for(
const auto& name : histogram_names) {
1901 stringhistogram_name(name.data(), name.size());
1902 const autoiter =
m_NamesMap.find(histogram_name);
1904 if(iter->second.m_Timing ==
nullptr) {
1911iter->second.m_Timing->SerializeSeries(most_ancient_time,
1914iter->second.m_Name,
1915iter->second.m_Description));
1916 if(iter->second.m_Counter !=
nullptr) {
1919iter->second.m_CounterName);
1920bytes_counter.
SetString(
"description",
1921iter->second.m_CounterDescription);
1923*(iter->second.m_Counter));
1924ret.
SetByKey(iter->second.m_CounterId,
1955max_requests =
max(max_requests, requests);
1956max_errors =
max(max_errors, errors);
1957max_warnings =
max(max_warnings, warnings);
unsigned long m_MinBlobSize
CBlobRetrieveTiming(unsigned long min_blob_size, unsigned long max_blob_size, unsigned long min_stat_value, unsigned long max_stat_value, unsigned long n_bins, TOnePSGTiming::EScaleType stat_type, bool &reset_to_default)
unsigned long m_MaxBlobSize
virtual CJsonNode SerializeCombined(int most_ancient_time, int most_recent_time, unsigned long tick_span, const string &name, const string &description) const
virtual CJsonNode SerializeSeries(int most_ancient_time, int most_recent_time, unsigned long tick_span, const string &name, const string &description) const
CHistogram â collect the distribution of the numerical data samples.
static CJsonNode NewArrayNode()
Create a new JSON array node.
void SetDouble(const string &key, double value)
Set a JSON object element to the specified floating point value.
void SetString(const string &key, const string &value)
Set a JSON object element to the specified string value.
void SetInteger(const string &key, Int8 value)
Set a JSON object element to the specified integer value.
void SetByKey(const string &key, CJsonNode::TInstance value)
For a JSON object node, insert a new element or update an existing element.
static CJsonNode NewObjectNode()
Create a new JSON object node.
void Append(CJsonNode::TInstance value)
For an array node, add a new element at the end of the array.
CJsonNode Serialize(const vector< pair< int, int >> &time_series, int most_ancient_time, int most_recent_time, bool loop, size_t current_index) const
CJsonNode Serialize(const vector< pair< int, int >> &time_series, int most_ancient_time, int most_recent_time, bool loop, size_t current_index) const
void RotateAvgPerfTimeSeries(void)
CMomentousCounterSeries m_BacklogStat
CMomentousCounterSeries m_TCPConnectionsStat
unique_ptr< CMyNCBITiming > m_RetrieveMyNCBIErrorTiming
string m_TooLongIDs[eOperationLast]
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
uint64_t Register(IPSGS_Processor *processor, EPSGOperation operation, EPSGOperationStatus status, const psg_time_point_t &op_begin_ts, size_t blob_size=0)
void RotateRequestStat(void)
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
void RegisterProcessorPerformance(IPSGS_Processor *processor, IPSGS_Processor::EPSGS_Status proc_finish_status)
CMonotonicCounterSeries m_ErrorTimeSeries
bool x_SetupBlobSizeBins(unsigned long min_stat_value, unsigned long max_stat_value, unsigned long n_bins, TOnePSGTiming::EScaleType stat_type, unsigned long small_blob_size)
vector< unique_ptr< CMyNCBITiming > > m_RetrieveMyNCBITiming
CRequestTimeSeries m_IdGetTSEChunkStat
void RegisterProcessorDone(CPSGS_Request::EPSGS_Type request_type, IPSGS_Processor *processor)
size_t m_LogTimingThresholdMks
unique_ptr< CBacklogTiming > m_BacklogTiming
COperationTiming(unsigned long min_stat_value, unsigned long max_stat_value, unsigned long n_bins, const string &stat_type, unsigned long small_blob_size, const string &only_for_processor, size_t log_timing_threshold, const map< string, size_t > &proc_group_to_index)
vector< unique_ptr< CLmdbCacheTiming > > m_LookupLmdbBioseqInfoTiming
vector< unique_ptr< CResolutionTiming > > m_ResolutionFoundCassandraTiming
CRequestTimeSeries m_IdGetNAStat
CJsonNode Serialize(int most_ancient_time, int most_recent_time, const vector< CTempString > &histogram_names, const vector< pair< int, int >> &time_series, unsigned long tick_span) const
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
void RegisterForTimeSeries(CPSGS_Request::EPSGS_Type request_type, CRequestStatus::ECode status)
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
void x_UpdateMaxReqsStat(size_t index, uint64_t &max_requests, uint64_t &max_errors, uint64_t &max_warnings, uint64_t &max_not_found) const
vector< unsigned long > m_Ends
void CollectMomentousStat(size_t tcp_conn_count, size_t active_request_count, size_t backlog_count)
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
ssize_t x_GetBlobRetrievalBinIndex(unsigned long blob_size)
static string TypeToString(EPSGS_Type req_type)
@ ePSGS_AnnotationRequest
@ ePSGS_BlobBySatSatKeyRequest
@ ePSGS_IPGResolveRequest
@ ePSGS_AccessionVersionHistoryRequest
@ ePSGS_BlobBySeqIdRequest
unique_ptr< TPSGTiming > m_PSGTiming
virtual CJsonNode SerializeCombined(int most_ancient_time, int most_recent_time, unsigned long tick_span, const string &name, const string &description) const
uint64_t GetMaxValue(void) const
virtual CJsonNode SerializeSeries(int most_ancient_time, int most_recent_time, unsigned long tick_span, const string &name, const string &description) const
static CPubseqGatewayApp * GetInstance(void)
void AppendData(size_t index, uint64_t &requests, uint64_t &errors, uint64_t &warnings, uint64_t ¬_found) const
CJsonNode Serialize(const vector< pair< int, int >> &time_series, int most_ancient_time, int most_recent_time, bool loop, size_t current_index) const
static EPSGSCounter RequestStatusToCounter(CRequestStatus::ECode status)
void Add(EPSGSCounter counter)
void GetLoopAndIndex(bool &loop, size_t ¤t_index) const
Interface class (and self-factory) for request processor objects that can retrieve data from a given ...
psg_time_point_t GetProcessInvokeTimestamp(bool &is_valid) const
Provides the timestamp of when the Process() method was called.
shared_ptr< CPSGS_Request > GetRequest(void) const
Provides the user request.
virtual string GetGroupName(void) const =0
Tells the processor group name.
EPSGS_Status
The GetStatus() method returns a processor current status.
Include a standard set of the NCBI C++ Toolkit most basic headers.
CDiagContext_Extra & Print(const string &name, const string &value)
The method does not print the argument, but adds it to the string.
CDiagContext & GetDiagContext(void)
Get diag context instance.
CDiagContext_Extra Extra(void) const
Create a temporary CDiagContext_Extra object.
@ e503_ServiceUnavailable
@ e505_HTTPVerNotSupported
@ e500_InternalServerError
unsigned GetNumberOfBins() const
Return the number ot bins on the combined scale.
CHistogram Clone(EClone how=eCloneAll) const
Clone histogram structure.
list< STimeBin > TTimeBins
Type of the series of histograms.
TSum GetSum(void) const
Return the sum of all added values.
size_t GetLowerAnomalyCount() const
Get number of hits whose values were less than GetMin().
void AddCountersFrom(const CHistogram &other)
Add counters from 'other' histogram to this histogram, 'other' doesn't changes.
const TScale * GetBinStartsPtr() const
Get starting positions for bins on the combined scale (not MT safe).
TValue GetMax() const
Get the upper bound of the combined scale.
const TCounter * GetBinCountersPtr() const
Get counters for the combined scale's bins (not MT safe).
TCounter GetCount() const
Get total number of hits whose value fell between GetMin() and GetMax().
size_t GetUpperAnomalyCount() const
Get number of hits whose values were greater than GetMax().
@ eLog2
Binary logarithmic scale with a base 2.
@ eLinear
Arithmetic or linear scale.
@ eCloneStructureOnly
Clone structure only (the counters will be zeroed)
static int CompareNocase(const CTempString s1, SIZE_TYPE pos, SIZE_TYPE n, const char *s2)
Case-insensitive compare of a substring with another string.
static string & Replace(const string &src, const string &search, const string &replace, string &dst, SIZE_TYPE start_pos=0, SIZE_TYPE max_replace=0, SIZE_TYPE *num_replace=0)
Replace occurrences of a substring within a string.
operation
Bit operations.
#define PSG_ERROR(message)
psg_clock_t::time_point psg_time_point_t
static constexpr size_t kSeriesIntervals
static string kCount("Count")
static string kValueSum("ValueSum")
static string kBins("Bins")
#define TIMING_CLASS_DEF(class_name)
static string kMaxValue("MaxValue")
static string kName("name")
static string kUpperAnomaly("UpperAnomaly")
static string kTotalCount("TotalCount")
static string kStartBlobSize("MinBlobSize")
static string kTimeRangeEnd("TimeRangeEnd")
static string kSecondsCovered("SecondsCovered")
CJsonNode SerializeHistogram(const TOnePSGTiming &histogram, const string &name, const string &description, uint64_t max_value)
static string kStart("Start")
static string kEnd("End")
const unsigned long kMaxBlobSize
static string kEndBlobSize("MaxBlobSize")
static string kLowerAnomaly("LowerAnomaly")
static string kDescription("description")
static string kTimeRangeStart("TimeRangeStart")
const unsigned long kNStatBins
const unsigned long kMinStatValue
@ eResolutionFoundInCassandra
const unsigned long kMaxStatValue
CHistogramTimeSeries< uint64_t, uint64_t, uint64_t > TPSGTiming
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4