-
Notifications
You must be signed in to change notification settings - Fork 485
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SPIRE Agent] add telemetry around LRU cache entry operations (#4335)
* [SPIRE Agent] add telemetry around LRU cache entry operations Signed-off-by: gordonhu7 <hu.gordon@hotmail.com> Co-authored-by: gordonhu7 <hu.gordon@hotmail.com> Co-authored-by: Evan Gilman <evan@spirl.com>
- Loading branch information
1 parent
00909f2
commit a3d3cb8
Showing
10 changed files
with
152 additions
and
15 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
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
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
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
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,23 @@ | ||
package agent | ||
|
||
import "github.com/spiffe/spire/pkg/common/telemetry" | ||
|
||
func IncrementEntriesAdded(m telemetry.Metrics, entriesAdded int) { | ||
m.IncrCounter([]string{telemetry.EntryAdded}, float32(entriesAdded)) | ||
} | ||
|
||
func IncrementEntriesUpdated(m telemetry.Metrics, entriesUpdated int) { | ||
m.IncrCounter([]string{telemetry.EntryUpdated}, float32(entriesUpdated)) | ||
} | ||
|
||
func IncrementEntriesRemoved(m telemetry.Metrics, entriesRemoved int) { | ||
m.IncrCounter([]string{telemetry.EntryRemoved}, float32(entriesRemoved)) | ||
} | ||
|
||
func SetEntriesMapSize(m telemetry.Metrics, recordMapSize int) { | ||
m.SetGauge([]string{telemetry.RecordMapSize}, float32(recordMapSize)) | ||
} | ||
|
||
func SetSVIDMapSize(m telemetry.Metrics, svidMapSize int) { | ||
m.SetGauge([]string{telemetry.SVIDMapSize}, float32(svidMapSize)) | ||
} |
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