Skip to content

Commit 6f2f7a0

Browse files
authored
Update protos and return TAtomicSharedPtr in metric extension (#353)
1 parent cdb5b8c commit 6f2f7a0

File tree

4 files changed

+40
-16
lines changed

4 files changed

+40
-16
lines changed

include/ydb-cpp-sdk/client/extensions/solomon_stats/pull_connector.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ class TMetricRegistryConnector: public NYdb::IExtension {
1616
return p.get();
1717
}
1818

19+
static NMonitoring::IMetricRegistry* ToRawPtr(TAtomicSharedPtr<NMonitoring::IMetricRegistry> p) {
20+
return p.Get();
21+
}
1922

2023
public:
2124
using IApi = NYdb::NSdkStats::IStatApi;
@@ -57,4 +60,12 @@ inline void AddMetricRegistry(NYdb::TDriver& driver, std::shared_ptr<NMonitoring
5760
driver.AddExtension<TConnector>(TConnector::TParams(ptr));
5861
}
5962

63+
inline void AddMetricRegistry(NYdb::TDriver& driver, TAtomicSharedPtr<NMonitoring::IMetricRegistry> ptr) {
64+
if (!ptr)
65+
return;
66+
using TConnector = TMetricRegistryConnector<TAtomicSharedPtr<NMonitoring::IMetricRegistry>>;
67+
68+
driver.AddExtension<TConnector>(TConnector::TParams(ptr));
69+
}
70+
6071
} // namespace NSolomonStatExtension

src/api/protos/draft/fq.proto

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -515,6 +515,11 @@ message MySQLCluster {
515515
IamAuth auth = 5;
516516
}
517517

518+
message Logging {
519+
string folder_id = 1;
520+
IamAuth auth = 2;
521+
}
522+
518523
message ConnectionSetting {
519524
enum ConnectionType {
520525
CONNECTION_TYPE_UNSPECIFIED = 0;
@@ -526,6 +531,7 @@ message ConnectionSetting {
526531
POSTGRESQL_CLUSTER = 6;
527532
GREENPLUM_CLUSTER = 7;
528533
MYSQL_CLUSTER = 8;
534+
LOGGING = 9;
529535
}
530536

531537
oneof connection {
@@ -537,6 +543,7 @@ message ConnectionSetting {
537543
PostgreSQLCluster postgresql_cluster = 6;
538544
GreenplumCluster greenplum_cluster = 7;
539545
MySQLCluster mysql_cluster = 8;
546+
Logging logging = 9;
540547
}
541548
}
542549

src/api/protos/ydb_cms.proto

Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -106,23 +106,28 @@ message DatabaseQuotas {
106106
repeated StorageQuotas storage_quotas = 6;
107107
}
108108

109-
// A policy that is used for resource scale recommendation. If multiple are used,
110-
// recommender combines them to recommend the largest scale.
111-
message ScaleRecommenderPolicy {
112-
// Policy that tracks metric and reactively recommend to adjust resources scale
113-
// to keep metric close to the specified target value.
114-
message TargetTrackingPolicy {
115-
oneof target {
116-
// A percentage of compute resources' average CPU utilization.
117-
uint32 average_cpu_utilization_percent = 1;
109+
message ScaleRecommenderPolicies {
110+
// A policy that is used for resource scale recommendation. If multiple are used,
111+
// recommender combines them to recommend the largest scale.
112+
message ScaleRecommenderPolicy {
113+
// Policy that tracks metric and reactively recommend to adjust resources scale
114+
// to keep metric close to the specified target value.
115+
message TargetTrackingPolicy {
116+
oneof target {
117+
// A percentage of compute resources' average CPU utilization.
118+
uint32 average_cpu_utilization_percent = 1;
119+
}
118120
}
119-
}
120121

121-
oneof policy {
122-
TargetTrackingPolicy target_tracking_policy = 1;
122+
oneof policy {
123+
TargetTrackingPolicy target_tracking_policy = 1;
124+
}
123125
}
126+
127+
repeated ScaleRecommenderPolicy policies = 1;
124128
}
125129

130+
126131
// Request to create a new database. For successfull creation
127132
// specified database shouldn't exist. At least one storage
128133
// unit should be requested for the database.
@@ -149,7 +154,7 @@ message CreateDatabaseRequest {
149154
// Optional quotas for the database
150155
DatabaseQuotas database_quotas = 10;
151156
// Optional scale recommender policies
152-
repeated ScaleRecommenderPolicy scale_recommender_policies = 11;
157+
ScaleRecommenderPolicies scale_recommender_policies = 11;
153158
}
154159

155160
message CreateDatabaseResponse {
@@ -201,7 +206,7 @@ message GetDatabaseStatusResult {
201206
// Current quotas for the database
202207
DatabaseQuotas database_quotas = 10;
203208
// Current scale recommender policies
204-
repeated ScaleRecommenderPolicy scale_recommender_policies = 11;
209+
ScaleRecommenderPolicies scale_recommender_policies = 11;
205210
}
206211

207212
// Change resources allocated for database.
@@ -230,8 +235,8 @@ message AlterDatabaseRequest {
230235
DatabaseQuotas database_quotas = 11;
231236
// Alter attributes. Leave the value blank to drop an attribute.
232237
map<string, string> alter_attributes = 12;
233-
// Alter scale recommender policies.
234-
repeated ScaleRecommenderPolicy scale_recommender_policies = 13;
238+
// Change scale recommender policies.
239+
ScaleRecommenderPolicies scale_recommender_policies = 13;
235240
}
236241

237242
message AlterDatabaseResponse {

src/api/protos/ydb_table.proto

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -518,6 +518,7 @@ message ColumnFamily {
518518
COMPRESSION_UNSPECIFIED = 0;
519519
COMPRESSION_NONE = 1;
520520
COMPRESSION_LZ4 = 2;
521+
COMPRESSION_ZSTD = 3;
521522
}
522523

523524
// Name of the column family, the name "default" must be used for the

0 commit comments

Comments
 (0)