This repository has been archived by the owner on Oct 9, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add logs and stats to sync loop (#573)
* Add logs and stats to sync loop Signed-off-by: Haytham Abuelfutuh <[email protected]> * Add per namespace log as well Signed-off-by: Haytham Abuelfutuh <[email protected]> --------- Signed-off-by: Haytham Abuelfutuh <[email protected]>
- Loading branch information
Showing
2 changed files
with
50 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package clusterresource | ||
|
||
// ResourceSyncStats is a simple struct to track the number of resources created, updated, already there, and errored | ||
type ResourceSyncStats struct { | ||
Created int | ||
Updated int | ||
AlreadyThere int | ||
Errored int | ||
} | ||
|
||
// Add adds the values of the other ResourceSyncStats to this one | ||
func (m *ResourceSyncStats) Add(other ResourceSyncStats) { | ||
m.Created += other.Created | ||
m.Updated += other.Updated | ||
m.AlreadyThere += other.AlreadyThere | ||
m.Errored += other.Errored | ||
} |