-
Notifications
You must be signed in to change notification settings - Fork 30
[NBS] Open different YDB graphs depending on the channel kind #3540
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 1 commit
291ed19
19b13d6
8ee1c58
a5cae67
382b61b
2a14694
aa6cb49
8f7b88d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -115,52 +115,90 @@ TString GetMonitoringNBSOverviewToTVUrl(const TDiagnosticsConfig& config) | |
<< data.MonitoringClusterName << "&p.host=" << GetShortHostName(); | ||
} | ||
|
||
TString GetMonitoringYDBGroupUrl( | ||
const TDiagnosticsConfig& config, | ||
ui32 groupId, | ||
const TString& storagePool, | ||
const TString& dataKind) | ||
TString | ||
GetQueries(ui32 groupId, const TString& storagePool, const TString& dataKind) | ||
{ | ||
constexpr TStringBuf GetFast = | ||
R"(q.0.s=histogram_percentile(100, {project="kikimr", cluster="*", storagePool="%s", group="%)" PRIu32 | ||
R"(", host="*", service="vdisks", subsystem="latency_histo", handleclass="GetFast"})&q.0.name=A)"; | ||
constexpr TStringBuf PutUserData = | ||
R"(q.1.s=histogram_percentile(100, {project="kikimr", cluster="*", storagePool="%s", group="%)" PRIu32 | ||
R"(", host="*", service="vdisks", subsystem="latency_histo", handleclass="PutUserData"})&q.1.name=B)"; | ||
constexpr TStringBuf PutTabletLog = | ||
R"(q.2.s=histogram_percentile(100, {project="kikimr", cluster="*", storagePool="%s", group="%)" PRIu32 | ||
R"(", host="*", service="vdisks", subsystem="latency_histo", handleclass="PutTabletLog"})&q.2.name=C)"; | ||
constexpr TStringBuf GetAsync = | ||
R"(q.2.s=histogram_percentile(100, {project="kikimr", cluster="*", storagePool="%s", group="%)" PRIu32 | ||
R"(", host="*", service="vdisks", subsystem="latency_histo", handleclass="GetAsync"})&q.2.name=C)"; | ||
constexpr TStringBuf PutAsyncBlob = | ||
R"(q.3.s=histogram_percentile(100, {project="kikimr", cluster="*", storagePool="%s", group="%)" PRIu32 | ||
R"(", host="*", service="vdisks", subsystem="latency_histo", handleclass="PutAsyncBlob"})&q.3.name=D)"; | ||
constexpr TStringBuf QueryPattern = | ||
R"(q.%u.s=histogram_percentile(100, {project="kikimr", cluster="*", storagePool="%s", group="%)" PRIu32 | ||
R"(", host="*", service="vdisks", subsystem="latency_histo", handleclass="%s"})&q.%u.name=%s)"; | ||
|
||
constexpr TStringBuf Url = | ||
"%s/projects/%s/explorer/" | ||
"queries?%sfrom=now-1d&to=now&refresh=60000"; | ||
constexpr std::array<TStringBuf, 2> DefaultHandleclasses( | ||
{"GetFast", "PutUserData"}); | ||
constexpr std::array<TStringBuf, 3> LogHandleclasses( | ||
{"GetFast", "PutUserData", "PutTabletLog"}); | ||
constexpr std::array<TStringBuf, 4> MergedAndMixedHandleclasses( | ||
{"GetFast", "PutUserData", "GetAsync", "PutAsyncBlob"}); | ||
|
||
constexpr std::array<TStringBuf, 4> QueryNames({"A", "B", "C", "D"}); | ||
komarevtsev-d marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
TStringBuilder queries; | ||
queries << Sprintf(GetFast.data(), storagePool.c_str(), groupId).c_str() | ||
<< "&" | ||
<< Sprintf(PutUserData.data(), storagePool.c_str(), groupId).c_str() | ||
<< "&"; | ||
|
||
komarevtsev-d marked this conversation as resolved.
Show resolved
Hide resolved
komarevtsev-d marked this conversation as resolved.
Show resolved
Hide resolved
|
||
if (dataKind == "Log") { | ||
queries << Sprintf(PutTabletLog.data(), storagePool.c_str(), groupId) | ||
.c_str() | ||
<< "&"; | ||
for (ui32 queryIdx = 0; queryIdx < LogHandleclasses.size(); ++queryIdx) | ||
{ | ||
queries << Sprintf( | ||
QueryPattern.data(), | ||
queryIdx, | ||
storagePool.c_str(), | ||
groupId, | ||
LogHandleclasses.at(queryIdx).Data(), | ||
queryIdx, | ||
QueryNames.at(queryIdx).Data()) | ||
.c_str() | ||
<< "&"; | ||
} | ||
|
||
return queries.c_str(); | ||
} | ||
|
||
if (dataKind == "Merged" || dataKind == "Mixed") { | ||
queries | ||
<< Sprintf(GetAsync.data(), storagePool.c_str(), groupId).c_str() | ||
<< "&" | ||
<< Sprintf(PutAsyncBlob.data(), storagePool.c_str(), groupId) | ||
.c_str(); | ||
for (ui32 queryIdx = 0; queryIdx < MergedAndMixedHandleclasses.size(); | ||
++queryIdx) | ||
{ | ||
queries << Sprintf( | ||
QueryPattern.data(), | ||
queryIdx, | ||
storagePool.c_str(), | ||
groupId, | ||
MergedAndMixedHandleclasses.at(queryIdx).Data(), | ||
queryIdx, | ||
QueryNames.at(queryIdx).Data()) | ||
.c_str() | ||
<< "&"; | ||
} | ||
|
||
return queries.c_str(); | ||
} | ||
|
||
for (ui32 queryIdx = 0; queryIdx < DefaultHandleclasses.size(); ++queryIdx) | ||
{ | ||
queries << Sprintf( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. может понятнее будет если строку формировать через << ? не смешивая old-school printf и потоки? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Мне кажется лучше как сейчас. |
||
QueryPattern.data(), | ||
queryIdx, | ||
storagePool.c_str(), | ||
groupId, | ||
DefaultHandleclasses.at(queryIdx).Data(), | ||
queryIdx, | ||
QueryNames.at(queryIdx).Data()) | ||
.c_str() | ||
<< "&"; | ||
} | ||
|
||
return queries.c_str(); | ||
komarevtsev-d marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} | ||
|
||
TString GetMonitoringYDBGroupUrl( | ||
const TDiagnosticsConfig& config, | ||
ui32 groupId, | ||
const TString& storagePool, | ||
const TString& dataKind) | ||
{ | ||
constexpr TStringBuf Url = | ||
"%s/projects/%s/explorer/" | ||
"queries?%sfrom=now-1d&to=now&refresh=60000"; | ||
|
||
auto queries = GetQueries(groupId, storagePool, dataKind); | ||
|
||
return Sprintf( | ||
Url.data(), | ||
config.GetMonitoringUrlData().MonitoringUrl.c_str(), | ||
|
Uh oh!
There was an error while loading. Please reload this page.