@@ -108,7 +108,7 @@ func BuildAndRegisterAggregator(downloader *Downloader, delegationTarget server.
108
108
// Build initial spec to serve.
109
109
klog .V (2 ).Infof ("Building initial OpenAPI spec" )
110
110
defer func (start time.Time ) {
111
- duration := time .Now (). Sub (start )
111
+ duration := time .Since (start )
112
112
klog .V (2 ).Infof ("Finished initial OpenAPI spec generation after %v" , duration )
113
113
114
114
regenerationCounter .With (map [string ]string {"apiservice" : "*" , "reason" : "startup" })
@@ -222,7 +222,7 @@ func (s *specAggregator) tryUpdatingServiceSpecs(specInfo *openAPISpecInfo) erro
222
222
}
223
223
klog .V (2 ).Infof ("Updating OpenAPI spec because %s is updated" , specInfo .apiService .Name )
224
224
defer func (start time.Time ) {
225
- duration := time .Now (). Sub (start )
225
+ duration := time .Since (start )
226
226
klog .V (2 ).Infof ("Finished OpenAPI spec generation after %v" , duration )
227
227
228
228
reason := "add"
@@ -254,7 +254,7 @@ func (s *specAggregator) tryDeleteServiceSpecs(apiServiceName string) error {
254
254
delete (s .openAPISpecs , apiServiceName )
255
255
klog .V (2 ).Infof ("Updating OpenAPI spec because %s is removed" , apiServiceName )
256
256
defer func (start time.Time ) {
257
- duration := time .Now (). Sub (start )
257
+ duration := time .Since (start )
258
258
klog .V (2 ).Infof ("Finished OpenAPI spec generation after %v" , duration )
259
259
260
260
regenerationCounter .With (map [string ]string {"apiservice" : apiServiceName , "reason" : "delete" })
0 commit comments