You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: pkg/scheduler/framework/cycle_state.go
+13-8Lines changed: 13 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -43,12 +43,12 @@ type StateKey string
43
43
// StateData stored by one plugin can be read, altered, or deleted by another plugin.
44
44
// CycleState does not provide any data protection, as all plugins are assumed to be
45
45
// trusted.
46
-
// Note: CycleState uses a sync.Map to back the storage. It's aimed to optimize for the "write once and read many times" scenarios.
47
-
// It is the recommended pattern used in all in-tree plugins - plugin-specific state is written once in PreFilter/PreScore and afterwards read many times in Filter/Score.
46
+
// Note: CycleState uses a sync.Map to back the storage, because it is thread safe. It's aimed to optimize for the "write once and read many times" scenarios.
47
+
// It is the recommended pattern used in all in-tree plugins - plugin-specific state is written once in PreFilter/PreScore and afterward read many times in Filter/Score.
48
48
typeCycleStatestruct {
49
49
// storage is keyed with StateKey, and valued with StateData.
50
50
storage sync.Map
51
-
// if recordPluginMetrics is true, PluginExecutionDuration will be recorded for this cycle.
51
+
// if recordPluginMetrics is true, metrics.PluginExecutionDuration will be recorded for this cycle.
52
52
recordPluginMetricsbool
53
53
// SkipFilterPlugins are plugins that will be skipped in the Filter extension point.
0 commit comments