Skip to content

Commit 0c7f3de

Browse files
Support for view datasets
- added support for view datasets - added support for transform costs of downstream objects in dataset summary view - Fixed #59 acceleration info for monitors v2
1 parent fdbb27b commit 0c7f3de

File tree

10 files changed

+209
-19
lines changed

10 files changed

+209
-19
lines changed

DataObjects/ObsDataset.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -473,6 +473,10 @@ public void AddAccelerationInfo(Dictionary<string, ObsDataset> allDatasetsDict,
473473
if (accelerationInfoObject != null)
474474
{
475475
this.Acceleration = new ObsAccelerationInfo(accelerationInfoObject, this, allDatasetsDict, allMonitorsDict);
476+
if (Acceleration.state == "View")
477+
{
478+
this.ObjectType = this.ObjectType | ObsCompositeObjectType.ViewDataset;
479+
}
476480
}
477481
}
478482

DataObjects/ObsMonitor2.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ public class ObsMonitor2 : ObsCompositeObject
1717
public List<ObsParameter> Parameters { get; set; } = new List<ObsParameter>(0);
1818
public Dictionary<string, ObsParameter> AllParametersDict { get; set; }
1919

20-
// public ObsAccelerationInfo Acceleration { get; set; }
21-
20+
public ObsDataset SupportingDataset { get; set; }
21+
2222
public List<ObjectRelationship> ExternalObjectRelationships { get; set; } = new List<ObjectRelationship>(8);
2323
public List<ObjectRelationship> StageObjectRelationships { get; set; } = new List<ObjectRelationship>(8);
2424

@@ -157,6 +157,7 @@ public void AddSupportingDataset(Dictionary<string, ObsDataset> allDatasetsDict)
157157
if (allDatasetsDict.TryGetValue(JSONHelper.getStringValueFromJToken(metaObject, "outputDatasetID"), out supportingDataset) == true)
158158
{
159159
this.ExternalObjectRelationships.Add(new ObjectRelationship(String.Format("{0} to {1} as {2}", supportingDataset.ToString(), this, ObsObjectRelationshipType.ProvidesData), this, supportingDataset, ObsObjectRelationshipType.ProvidesData));
160+
this.SupportingDataset = supportingDataset;
160161
}
161162
}
162163
}

DataObjects/base/ObsCompositeObjectType.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ public enum ObsCompositeObjectType
2828
MonitorSupportDataset = 1 << 17,
2929
InterfaceMetricDataset = 1 << 18,
3030
InterfaceLogDataset = 1 << 19,
31+
ViewDataset = 1 << 25,
3132

3233
Datastream = 1 << 20,
3334
Token = 1 << 21,

InventoryModel/ObserveEnvironment.cs

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1298,6 +1298,7 @@ public string RenderGraphOfRelationships(ObsObject interestingObject, List<Objec
12981298

12991299
// Output edges
13001300
sb.AppendLine("// Edges");
1301+
allRelationships = allRelationships.OrderBy(r => r.ThisObject.GetType().Name).ThenBy(r => r.ThisObject.name).ThenBy(r => r.RelatedObject.GetType().Name).ThenBy(r => r.RelatedObject.name).ToList();
13011302
foreach (ObjectRelationship relationship in allRelationships)
13021303
{
13031304
// We're not going to output relationships to metrics
@@ -2100,7 +2101,7 @@ internal string getIconTokenType(ObsToken obsToken)
21002101
};
21012102
}
21022103

2103-
internal string getIconType(ObsMetric obsDataset)
2104+
internal string getIconType(ObsMetric obsMetric)
21042105
{
21052106
return "📶";
21062107
}
@@ -2254,16 +2255,16 @@ internal string getIconFieldType(ObsFieldDefinition obsFieldDefinition)
22542255
{
22552256
return obsFieldDefinition.type switch
22562257
{
2257-
"timestamp" => "🕘",
2258-
"duration" => "⏰",
2259-
"string" => "📝",
2260-
"int64" => "⑽",
2261-
"float64" => "⒑",
2262-
"object" => "🎛",
2263-
"variant" => "💫",
2264-
"array" => "🔢",
2265-
"bool" => "❓",
2266-
_ => " "
2258+
"timestamp" => "🕘",
2259+
"duration" => "⏰",
2260+
"string" => "📝",
2261+
"int64" => "⑽",
2262+
"float64" => "⒑",
2263+
"object" => "🎛",
2264+
"variant" => "💫",
2265+
"array" => "🔢",
2266+
"bool" => "❓",
2267+
_ => " "
22672268
};
22682269
}
22692270

Views/Details/Dataset.cshtml

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -892,6 +892,9 @@
892892
<th>Uses</th>
893893
<th>Created</th>
894894
<th>Updated</th>
895+
<th>Query 1h</th>
896+
<th>Query 1d</th>
897+
<th>Query 1w</th>
895898
</thead>
896899
<tbody>
897900
@foreach (ObsDashboard entity in selectedDashboards)
@@ -924,6 +927,9 @@
924927
</td>
925928
<td>@entity.createdDate.ToString("u")/@entity.createdBy.label</td>
926929
<td>@entity.updatedDate.ToString("u")/@entity.updatedBy.label</td>
930+
<td>@entity.Query1H.Credits.ToString("##0.#")</td>
931+
<td>@entity.Query1D.Credits.ToString("##0.#")</td>
932+
<td>@entity.Query1W.Credits.ToString("##0.#")</td>
927933
</tr>
928934
}
929935
</tbody>
@@ -958,6 +964,13 @@
958964
<th>Uses</th>
959965
<th>Created</th>
960966
<th>Updated</th>
967+
<th>Transform 1h</th>
968+
<th>Transform 1d</th>
969+
<th>Transform 1w</th>
970+
<th>Acc Conf.</th>
971+
<th>Acc Eff.</th>
972+
<th>Acc Actl.</th>
973+
<th>Acc Range</th>
961974
</thead>
962975
<tbody>
963976
@foreach (ObsMonitor entity in selectedMonitors)
@@ -996,6 +1009,27 @@
9961009
</td>
9971010
<td>@entity.createdDate.ToString("u")/@entity.createdBy.label</td>
9981011
<td>@entity.updatedDate.ToString("u")/@entity.updatedBy.label</td>
1012+
<td>@entity.Transform1H.Credits.ToString("##0.#")</td>
1013+
<td>@entity.Transform1D.Credits.ToString("##0.#")</td>
1014+
<td>@entity.Transform1W.Credits.ToString("##0.#")</td>
1015+
<td><span title="Configured staleness target of the dataset">@entity.Acceleration.StalenessConfigured</span></td>
1016+
<td>
1017+
@{
1018+
string highlightClass = "";
1019+
if (entity.Acceleration.StalenessEffective < entity.Acceleration.StalenessConfigured)
1020+
{
1021+
highlightClass = "accelSettingDifferent";
1022+
}
1023+
}
1024+
<span title="The target staleness of this dataset when taking downstream datasets" class="@highlightClass">@entity.Acceleration.StalenessEffective</span>
1025+
</td>
1026+
<td><span title="Staleness of the dataset (averaged over some moving window)">@entity.Acceleration.StalenessActual</span></td>
1027+
<td>
1028+
@foreach (ObsTimeRange timeRange in @entity.Acceleration.AcceleratedRanges)
1029+
{
1030+
<span title="@timeRange.start.ToString("u") - @timeRange.end.ToString("u")">@timeRange.duration</span>
1031+
}
1032+
</td>
9991033
</tr>
10001034
}
10011035
</tbody>
@@ -1029,6 +1063,13 @@
10291063
<th>Uses</th>
10301064
<th>Created</th>
10311065
<th>Updated</th>
1066+
<th>Transform 1h</th>
1067+
<th>Transform 1d</th>
1068+
<th>Transform 1w</th>
1069+
<th>Acc Conf.</th>
1070+
<th>Acc Eff.</th>
1071+
<th>Acc Actl.</th>
1072+
<th>Acc Range</th>
10321073
</thead>
10331074
<tbody>
10341075
@foreach (ObsMonitor2 entity in selectedMonitors2)
@@ -1066,6 +1107,41 @@
10661107
</td>
10671108
<td>@entity.createdDate.ToString("u")/@entity.createdBy.label</td>
10681109
<td>@entity.updatedDate.ToString("u")/@entity.updatedBy.label</td>
1110+
<td>@entity.Transform1H.Credits.ToString("##0.#")</td>
1111+
<td>@entity.Transform1D.Credits.ToString("##0.#")</td>
1112+
<td>@entity.Transform1W.Credits.ToString("##0.#")</td>
1113+
<td>
1114+
@if(entity.SupportingDataset != null)
1115+
{
1116+
<span title="Configured staleness target of the dataset">@entity.SupportingDataset.Acceleration.StalenessConfigured</span>
1117+
}
1118+
</td>
1119+
<td>
1120+
@if(entity.SupportingDataset != null)
1121+
{
1122+
string highlightClass = "";
1123+
if (entity.SupportingDataset.Acceleration.StalenessEffective < entity.SupportingDataset.Acceleration.StalenessConfigured)
1124+
{
1125+
highlightClass = "accelSettingDifferent";
1126+
}
1127+
<span title="The target staleness of this dataset when taking downstream datasets" class="@highlightClass">@entity.SupportingDataset.Acceleration.StalenessEffective</span>
1128+
}
1129+
</td>
1130+
<td>
1131+
@if(entity.SupportingDataset != null)
1132+
{
1133+
<span title="Staleness of the dataset (averaged over some moving window)">@entity.SupportingDataset.Acceleration.StalenessActual</span>
1134+
}
1135+
</td>
1136+
<td>
1137+
@if(entity.SupportingDataset != null)
1138+
{
1139+
@foreach (ObsTimeRange timeRange in @entity.SupportingDataset.Acceleration.AcceleratedRanges)
1140+
{
1141+
<span title="@timeRange.start.ToString("u") - @timeRange.end.ToString("u")">@timeRange.duration</span>
1142+
}
1143+
}
1144+
</td>
10691145
</tr>
10701146
}
10711147
</tbody>

Views/Details/Monitor.cshtml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -404,14 +404,14 @@
404404
<a href="#top">Back to Top</a>
405405

406406
<table class="AlternatingRowTable SortableTable">
407-
<tr>
407+
<thead>
408408
<th>Details</th>
409409
<th>Type</th>
410410
<th>Name</th>
411411
<th>ID</th>
412412
<th>Uses</th>
413413
<th>Used By</th>
414-
</tr>
414+
</thead>
415415
@foreach (ObsStage entity in Model.CurrentMonitor.Stages)
416416
{
417417
<tr>

Views/Details/Monitor2.cshtml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
<h1>@Model.ObserveEnvironment.getIconType(@Model.CurrentMonitor) Monitor v2 Details - @Model.CurrentMonitor.name (@Model.CurrentMonitor.id)</h1>
2424

2525
<p>
26+
<a href="#Acceleration">🚄 Acceleration</a>
2627
<a href="#RelatedDatasetsAncestors">⏫ Ancestors/Inputs</a>
2728
<a href="#RelatedDatasetsSupporting">⏬ Supporting</a>
2829
<a href="#RelatedDatasetsGraph">🔀 Related Datasets Graph</a>
@@ -133,6 +134,75 @@
133134
</tr> *@
134135
</table>
135136

137+
@if(Model.CurrentMonitor.SupportingDataset != null)
138+
{
139+
<h2 id="Acceleration">🚄 Acceleration</h2>
140+
<a href="#top">Back to Top</a>
141+
142+
<table>
143+
<tr>
144+
<td>State</td>
145+
<td>@Model.CurrentMonitor.SupportingDataset.Acceleration.state</td>
146+
<td></td>
147+
</tr>
148+
<tr>
149+
<td>Always Accelerated</td>
150+
<td>@Model.CurrentMonitor.SupportingDataset.Acceleration.alwaysAccelerated</td>
151+
<td>Whether the dataset is "always accelerated", i.e., any query should hit accelerated data.</td>
152+
</tr>
153+
<tr>
154+
<td>Staleness Configured</td>
155+
<td style="text-align: right">@Model.CurrentMonitor.SupportingDataset.Acceleration.StalenessConfigured</td>
156+
<td>Configured staleness target of the dataset.</td>
157+
</tr>
158+
<tr>
159+
<td>Staleness Effective</td>
160+
<td style="text-align: right">@Model.CurrentMonitor.SupportingDataset.Acceleration.StalenessEffective</td>
161+
<td>The target staleness of this dataset when taking downstream datasets.</td>
162+
</tr>
163+
<tr>
164+
<td>Staleness Target</td>
165+
<td style="text-align: right">@Model.CurrentMonitor.SupportingDataset.Acceleration.StalenessTarget</td>
166+
<td>The actual staleness target of the dataset.</td>
167+
</tr>
168+
<tr>
169+
<td>Staleness Downstream</td>
170+
<td style="text-align: right">@Model.CurrentMonitor.SupportingDataset.Acceleration.StalenessDownstream</td>
171+
<td>The minimum configured target staleness across all datasets downstream of this dataset.</td>
172+
</tr>
173+
<tr>
174+
<td>Staleness Actual</td>
175+
<td style="text-align: right">@Model.CurrentMonitor.SupportingDataset.Acceleration.StalenessActual</td>
176+
<td>Staleness of the dataset (averaged over some moving window).</td>
177+
</tr>
178+
<tr>
179+
<td>EffectiveOnDemandMaterializationLength</td>
180+
<td style="text-align: right">@Model.CurrentMonitor.SupportingDataset.Acceleration.EffectiveOnDemandMaterializationLength</td>
181+
<td>How far back users can request backfill.</td>
182+
</tr>
183+
@foreach (ObsTimeRange timeRange in Model.CurrentMonitor.SupportingDataset.Acceleration.AcceleratedRanges)
184+
{
185+
<tr>
186+
<td>Actual AcceleratedRange</td>
187+
<td style="text-align: right">@timeRange.duration</td>
188+
<td>@timeRange.start.ToString("u") - @timeRange.end.ToString("u")</td>
189+
</tr>
190+
}
191+
@foreach (ObsTimeRange timeRange in Model.CurrentMonitor.SupportingDataset.Acceleration.AcceleratedRangesTarget)
192+
{
193+
<tr>
194+
<td>Target AcceleratedRange</td>
195+
<td style="text-align: right">@timeRange.duration</td>
196+
<td>@timeRange.start.ToString("u") - @timeRange.end.ToString("u")</td>
197+
</tr>
198+
}
199+
<tr>
200+
<td>Raw</td>
201+
<td colspan="2"><pre><code class="language-json">@Model.CurrentMonitor.SupportingDataset.AccelerationInfo</code></pre></td>
202+
</tr>
203+
</table>
204+
}
205+
136206
@{
137207
List<ObjectRelationship> ancestorRelationships = Model.ObserveEnvironment.GetAllAncestorRelationshipsOfThis(@Model.CurrentMonitor);
138208
if (ancestorRelationships.Count > 0)

Views/Select/Dataset.cshtml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@
2727
ObsCompositeObjectType.MetricSMADataset,
2828
ObsCompositeObjectType.MonitorSupportDataset,
2929
ObsCompositeObjectType.InterfaceMetricDataset,
30-
ObsCompositeObjectType.InterfaceLogDataset};
30+
ObsCompositeObjectType.InterfaceLogDataset,
31+
ObsCompositeObjectType.ViewDataset};
3132
}
3233
<p>
3334
@foreach (ObsCompositeObjectType objectType in categoriesOfDatasets)

Views/Select/Monitor2.cshtml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,10 @@
5959
<th>Transform 1h</th>
6060
<th>Transform 1d</th>
6161
<th>Transform 1w</th>
62+
<th>Acc Conf.</th>
63+
<th>Acc Eff.</th>
64+
<th>Acc Actl.</th>
65+
<th>Acc Range</th>
6266
</thead>
6367
<tbody>
6468
@foreach (ObsMonitor2 entity in selectedMonitors)
@@ -98,6 +102,38 @@
98102
<td>@entity.Transform1H.Credits.ToString("##0.#")</td>
99103
<td>@entity.Transform1D.Credits.ToString("##0.#")</td>
100104
<td>@entity.Transform1W.Credits.ToString("##0.#")</td>
105+
<td>
106+
@if(entity.SupportingDataset != null)
107+
{
108+
<span title="Configured staleness target of the dataset">@entity.SupportingDataset.Acceleration.StalenessConfigured</span>
109+
}
110+
</td>
111+
<td>
112+
@if(entity.SupportingDataset != null)
113+
{
114+
string highlightClass = "";
115+
if (entity.SupportingDataset.Acceleration.StalenessEffective < entity.SupportingDataset.Acceleration.StalenessConfigured)
116+
{
117+
highlightClass = "accelSettingDifferent";
118+
}
119+
<span title="The target staleness of this dataset when taking downstream datasets" class="@highlightClass">@entity.SupportingDataset.Acceleration.StalenessEffective</span>
120+
}
121+
</td>
122+
<td>
123+
@if(entity.SupportingDataset != null)
124+
{
125+
<span title="Staleness of the dataset (averaged over some moving window)">@entity.SupportingDataset.Acceleration.StalenessActual</span>
126+
}
127+
</td>
128+
<td>
129+
@if(entity.SupportingDataset != null)
130+
{
131+
@foreach (ObsTimeRange timeRange in @entity.SupportingDataset.Acceleration.AcceleratedRanges)
132+
{
133+
<span title="@timeRange.start.ToString("u") - @timeRange.end.ToString("u")">@timeRange.duration</span>
134+
}
135+
}
136+
</td>
101137
</tr>
102138
}
103139
</tbody>

observe-entity-explorer.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
<RootNamespace>Observe.EntityExplorer</RootNamespace>
88
<ApplicationIcon>AppIcon.ico</ApplicationIcon>
99

10-
<Version>2025.7.10.0</Version>
11-
<FileVersion>2025.7.10.0</FileVersion>
12-
<AssemblyVersion>2025.7.10.0</AssemblyVersion>
10+
<Version>2025.8.6.0</Version>
11+
<FileVersion>2025.8.6.0</FileVersion>
12+
<AssemblyVersion>2025.8.6.0</AssemblyVersion>
1313
<Authors>Daniel Odievich ([email protected])</Authors>
1414
<Company>Observe Inc.</Company>
1515
<Product>Observe Entity Explorer</Product>

0 commit comments

Comments
 (0)