@@ -23,6 +23,11 @@ using namespace NNodes;
23
23
24
24
namespace {
25
25
26
+ TString GetLastName (const TString& fullName) {
27
+ auto n = fullName.find_last_of (' /' );
28
+ return (n == fullName.npos ) ? fullName : fullName.substr (n + 1 );
29
+ }
30
+
26
31
bool ExtractSettingValue (const TExprNode& value, TStringBuf settingName, TExprContext& ctx, TStringBuf& settingValue) {
27
32
if (value.IsAtom ()) {
28
33
settingValue = value.Content ();
@@ -116,7 +121,7 @@ class TSolomonDqIntegration: public TDqIntegrationBase {
116
121
117
122
auto settings = soReadObject.Object ().Settings ();
118
123
auto & settingsRef = settings.Ref ();
119
- TInstant from = TInstant::Now () - TDuration::Hours ( 1 );
124
+ TInstant from = TInstant::Zero ( );
120
125
TInstant to = TInstant::Now ();
121
126
TString program;
122
127
TString selectors;
@@ -437,6 +442,50 @@ class TSolomonDqIntegration: public TDqIntegrationBase {
437
442
sinkType = " SolomonSink" ;
438
443
}
439
444
445
+ bool FillSourcePlanProperties (const NNodes::TExprBase& node, TMap<TString, NJson::TJsonValue>& properties) override {
446
+ if (!node.Maybe <TDqSource>()) {
447
+ return false ;
448
+ }
449
+
450
+ auto source = node.Cast <TDqSource>();
451
+ const auto maybeSettings = source.Settings ().Maybe <TSoSourceSettings>();
452
+ if (!maybeSettings) {
453
+ return false ;
454
+ }
455
+
456
+ const auto settings = maybeSettings.Cast ();
457
+ const auto & cluster = source.DataSource ().Cast <TSoDataSource>().Cluster ().StringValue ();
458
+ const auto * clusterDesc = State_->Configuration ->ClusterConfigs .FindPtr (cluster);
459
+
460
+ properties[" ExternalDataSource" ] = GetLastName (cluster);
461
+ properties[" ClusterType" ] = clusterDesc->GetClusterType () == TSolomonClusterConfig::SCT_SOLOMON ? " solomon" : " monitoring" ;
462
+
463
+ properties[" From" ] = settings.From ().StringValue ();
464
+ properties[" To" ] = settings.To ().StringValue ();
465
+
466
+ auto selectors = settings.Selectors ().StringValue ();
467
+ if (!selectors.empty ()) {
468
+ properties[" Selectors" ] = selectors;
469
+ }
470
+
471
+ auto program = settings.Program ().StringValue ();
472
+ if (!program.empty ()) {
473
+ properties[" Program" ] = program;
474
+ }
475
+
476
+ const bool isDisabled = FromString<bool >(settings.DownsamplingDisabled ().Literal ().Value ());
477
+ if (!isDisabled) {
478
+ properties[" DownsamplingDisabled" ] = " false" ;
479
+ properties[" DownsamplingAggregation" ] = settings.DownsamplingAggregation ().StringValue ();
480
+ properties[" DownsamplingFill" ] = settings.DownsamplingFill ().StringValue ();
481
+ properties[" DownsamplingGridInterval" ] = settings.DownsamplingGridSec ().Literal ().Value ();
482
+ } else {
483
+ properties[" DownsamplingDisabled" ] = " true" ;
484
+ }
485
+
486
+ return true ;
487
+ }
488
+
440
489
void RegisterMkqlCompiler (NCommon::TMkqlCallableCompilerBase& compiler) override {
441
490
RegisterDqSolomonMkqlCompilers (compiler);
442
491
}
0 commit comments