Skip to content

Commit

Permalink
Add cpuUsage cache to ec2 instance
Browse files Browse the repository at this point in the history
  • Loading branch information
veit.heller committed Mar 27, 2024
1 parent a2333c0 commit 4ee43dd
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Gt4Aws/GtAwsEc2Instance.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ Class {
#instVars : [
'id',
'type',
'launchTime'
'launchTime',
'cpuUsage'
],
#category : #'Gt4Aws-Model'
}
Expand All @@ -30,7 +31,8 @@ GtAwsEc2Instance class >> resourceType [

{ #category : #accessing }
GtAwsEc2Instance >> cpuUsage [
^ self client cloudWatchWeeklyCpuDataFor: self id
^ cpuUsage
ifNil: [ cpuUsage := self client cloudWatchWeeklyCpuDataFor: self id ]
]

{ #category : #accessing }
Expand Down

0 comments on commit 4ee43dd

Please sign in to comment.