Skip to content

Commit

Permalink
NBS-4748: review fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
komarevtsev-d committed Jan 21, 2024
1 parent e0e4fce commit 8b2450e
Show file tree
Hide file tree
Showing 9 changed files with 30 additions and 33 deletions.
2 changes: 1 addition & 1 deletion cloud/blockstore/libs/diagnostics/hostname.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ TString GetMonitoringNBSOverviewToTVUrl(const TDiagnosticsConfig& config)
<< data.MonitoringClusterName << "&p.host=cluster";
}

TString GetSolomonBsProxyUrl(
TString GetMonitoringYDBGroupUrl(
const TDiagnosticsConfig& config,
ui32 groupId,
const TString& storagePool)
Expand Down
2 changes: 1 addition & 1 deletion cloud/blockstore/libs/diagnostics/hostname.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ TString GetMonitoringVolumeUrl(

TString GetMonitoringPartitionUrl(const TDiagnosticsConfig& config);

TString GetSolomonBsProxyUrl(
TString GetMonitoringYDBGroupUrl(
const TDiagnosticsConfig& config,
ui32 groupId,
const TString& storagePool);
Expand Down
2 changes: 1 addition & 1 deletion cloud/blockstore/libs/storage/core/monitoring_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -981,7 +981,7 @@ void DumpMonitoringVolumeLink(
}
}

void DumpSolomonPartitionLink(
void DumpMonitoringPartitionLink(
IOutputStream& out,
const TDiagnosticsConfig& config)
{
Expand Down
2 changes: 1 addition & 1 deletion cloud/blockstore/libs/storage/core/monitoring_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ void DumpMonitoringVolumeLink(
const TDiagnosticsConfig& config,
const TString& diskId);

void DumpSolomonPartitionLink(
void DumpMonitoringPartitionLink(
IOutputStream& out,
const TDiagnosticsConfig& config);

Expand Down
43 changes: 22 additions & 21 deletions cloud/blockstore/libs/storage/partition/part_actor_monitoring.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,17 @@
#include <cloud/blockstore/libs/storage/core/probes.h>
#include <cloud/blockstore/libs/storage/core/tenant.h>
#include <cloud/blockstore/libs/storage/model/channel_data_kind.h>

#include <cloud/storage/core/libs/common/format.h>

#include <contrib/ydb/core/base/appdata.h>

#include <library/cpp/monlib/service/pages/templates.h>
#include <library/cpp/cgiparam/cgiparam.h>
#include <library/cpp/monlib/service/pages/templates.h>

#include <util/stream/str.h>

#include <contrib/ydb/core/base/appdata.h>

#include <ranges>

namespace NCloud::NBlockStore::NStorage::NPartition {

using namespace NKikimr;
Expand Down Expand Up @@ -66,23 +67,23 @@ void DumpDownGroups(
}
return entry->GroupID == groupId;
};
auto it = std::ranges::find_if(
storage.Channels,
groupIdFinder);
if (it == storage.Channels.end() ||
std::any_of(
it + 1,
storage.Channels.end(),
groupIdFinder))
{
auto matchedInfos = storage.Channels |
std::views::filter(groupIdFinder);
if (matchedInfos.empty()) {
out << groupId;
} else {
out << groupId << " <a href='"
<< GetSolomonBsProxyUrl(
config,
groupId,
it->StoragePool)
<< "'>Graphs</a>";
for (const TTabletChannelInfo& channelInfo:
matchedInfos)
{
out << groupId << "&nbsp;<a href='"
<< GetMonitoringYDBGroupUrl(
config,
groupId,
channelInfo.StoragePool)
<< "'>Graphs&nbsp;"
<< "(Channel=" << channelInfo.Channel
<< ")</a><br/>";
}
}
}
TABLEH() {
Expand Down Expand Up @@ -180,7 +181,7 @@ void DumpChannels(
}
TABLED() {
out << "<a href='"
<< GetSolomonBsProxyUrl(
<< GetMonitoringYDBGroupUrl(
config,
latestEntry->GroupID,
channel.StoragePool)
Expand Down Expand Up @@ -518,7 +519,7 @@ void TPartitionActor::HandleHttpInfo_Default(
DIV_CLASS("tab-content") {
DIV_CLASS_ID("tab-pane active", "Overview") {
DumpDefaultHeader(out, *Info(), SelfId().NodeId(), *DiagnosticsConfig);
DumpSolomonPartitionLink(out, *DiagnosticsConfig);
DumpMonitoringPartitionLink(out, *DiagnosticsConfig);

TAG(TH3) { out << "State"; }
State->DumpHtml(out);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ void DumpChannels(
}
TABLED() {
out << "<a href='"
<< GetSolomonBsProxyUrl(
<< GetMonitoringYDBGroupUrl(
config,
latestEntry->GroupID,
channel.StoragePool)
Expand Down Expand Up @@ -331,7 +331,7 @@ void TPartitionActor::HandleHttpInfo_Default(
DIV_CLASS("tab-content") {
DIV_CLASS_ID("tab-pane active", "Overview") {
DumpDefaultHeader(out, *Info(), SelfId().NodeId(), *DiagnosticsConfig);
DumpSolomonPartitionLink(out, *DiagnosticsConfig);
DumpMonitoringPartitionLink(out, *DiagnosticsConfig);

TAG(TH3) { out << "State"; }
State->DumpHtml(out);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#include "volume_actor.h"

#include <cloud/blockstore/libs/diagnostics/config.h>
#include <cloud/blockstore/libs/storage/api/disk_registry_proxy.h>
#include <cloud/blockstore/libs/storage/core/config.h>
#include <cloud/blockstore/libs/storage/partition_nonrepl/config.h>

Expand Down
2 changes: 1 addition & 1 deletion cloud/filestore/config/diagnostics.proto
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import "cloud/storage/core/protos/trace.proto";

message TMonitoringUrlData
{
// Monitoring cluster name (e.g. yandexcloud_prod_vla).
// Monitoring cluster name.
optional string MonitoringClusterName = 1;
// Monitoring host url.
optional string MonitoringUrl = 2;
Expand Down
5 changes: 1 addition & 4 deletions cloud/filestore/libs/diagnostics/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,7 @@ struct TMonitoringUrlData: public TAtomicRefCount<TMonitoringUrlData>
TString MonitoringUrl;
TString MonitoringProject;

TMonitoringUrlData()
: MonitoringUrl("https://monitoring.yandex-team.ru")
, MonitoringProject("nfs")
{}
TMonitoringUrlData() : MonitoringProject("nfs") {}
TMonitoringUrlData(const TMonitoringUrlData& rhs) = default;

TMonitoringUrlData(const NProto::TMonitoringUrlData& data)
Expand Down

0 comments on commit 8b2450e

Please sign in to comment.