File tree Expand file tree Collapse file tree 3 files changed +20
-15
lines changed
Expand file tree Collapse file tree 3 files changed +20
-15
lines changed Original file line number Diff line number Diff line change @@ -1113,17 +1113,6 @@ impl Glean {
11131113 . get_value ( self , None )
11141114 }
11151115
1116- /// Returns the ObjectMetric used to store Server Knobs configuration.
1117- pub ( crate ) fn server_knobs_metric ( ) -> metrics:: ObjectMetric {
1118- metrics:: ObjectMetric :: new ( CommonMetricData {
1119- name : "server_knobs_config" . into ( ) ,
1120- category : "glean.internal" . into ( ) ,
1121- send_in_pings : vec ! [ INTERNAL_STORAGE . into( ) ] ,
1122- lifetime : Lifetime :: Application ,
1123- ..Default :: default ( )
1124- } )
1125- }
1126-
11271116 /// Set configuration to override the default state, typically initiated from a
11281117 /// remote_settings experiment or rollout
11291118 ///
@@ -1153,8 +1142,9 @@ impl Glean {
11531142 drop ( remote_settings_config) ; // Release lock before storage operation
11541143
11551144 // Store the configuration using the server knobs ObjectMetric
1156- let server_knobs_metric = Self :: server_knobs_metric ( ) ;
1157- server_knobs_metric. set_sync ( self , serde_json:: to_value ( & config_clone) . unwrap ( ) ) ;
1145+ self . additional_metrics
1146+ . server_knobs_config
1147+ . set_sync ( self , serde_json:: to_value ( & config_clone) . unwrap ( ) ) ;
11581148
11591149 // Update remote_settings epoch
11601150 self . remote_settings_epoch . fetch_add ( 1 , Ordering :: SeqCst ) ;
Original file line number Diff line number Diff line change @@ -44,6 +44,9 @@ pub struct AdditionalMetrics {
4444 /// The number of times we had to clamp an event timestamp
4545 /// for exceeding the range of a signed 64-bit integer (9223372036854775807).
4646 pub event_timestamp_clamped : CounterMetric ,
47+
48+ /// Server knobs configuration received from remote settings.
49+ pub server_knobs_config : ObjectMetric ,
4750}
4851
4952impl CoreMetrics {
@@ -211,6 +214,15 @@ impl AdditionalMetrics {
211214 disabled : false ,
212215 dynamic_label : None ,
213216 } ) ,
217+
218+ server_knobs_config : ObjectMetric :: new ( CommonMetricData {
219+ name : "server_knobs_config" . into ( ) ,
220+ category : "glean.internal.metrics" . into ( ) ,
221+ send_in_pings : vec ! [ "glean_internal_info" . into( ) ] ,
222+ lifetime : Lifetime :: Application ,
223+ disabled : false ,
224+ dynamic_label : None ,
225+ } ) ,
214226 }
215227 }
216228}
Original file line number Diff line number Diff line change @@ -163,8 +163,11 @@ impl PingMaker {
163163 } ;
164164
165165 // Get the Server Knobs configuration, if available.
166- let server_knobs_metric = crate :: Glean :: server_knobs_metric ( ) ;
167- if let Some ( config_json) = server_knobs_metric. get_value ( glean, INTERNAL_STORAGE ) {
166+ if let Some ( config_json) = glean
167+ . additional_metrics
168+ . server_knobs_config
169+ . get_value ( glean, INTERNAL_STORAGE )
170+ {
168171 let server_knobs_config = serde_json:: from_str ( & config_json) . unwrap ( ) ;
169172 map. as_object_mut ( )
170173 . unwrap ( ) // safe unwrap, we created the object above
You can’t perform that action at this time.
0 commit comments