Skip to content

Commit 4f92126

Browse files
committed
🚑 hotfix timestamps
modified: README.md; modified: controllers/pod_controller.go
1 parent 7c1ed63 commit 4f92126

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ It then goes "upstream" to the parent controller of that pod, for example *Deplo
1919

2020
<img src="./assets/example.png" width="200">
2121

22-
Note: This is an alternative to [Vertical-Pod-Autoscaler](https://github.com/kubernetes/autoscaler/tree/master/vertical-pod-autoscaler). The intended use of this project is to provide a simpler, more straightforward install and mechanism, without CRDs, **and that can work with [Horizontal-Pod-Autoscaler](https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/).**
22+
**Note:** This is an alternative to [Vertical-Pod-Autoscaler](https://github.com/kubernetes/autoscaler/tree/master/vertical-pod-autoscaler). The intended use of this project is to provide a simpler, more straightforward install and mechanism, without CRDs, **and that can work with [Horizontal-Pod-Autoscaler](https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/).**
2323
## Deploy - Helm
2424

2525
```bash

controllers/pod_controller.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,12 @@ func (r *PodReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.R
103103
log.Error(err, err.Error())
104104
} else {
105105
SumPodRequest.Sample = LatestPodRequest.Sample + 1
106+
if LatestPodRequest.Sample == 1 {
107+
SumPodRequest.Timestamp = time.Now()
108+
}
106109
log.Info(fmt.Sprint(time.Now(), LatestPodRequest.Timestamp))
107110
SumPodRequest.TimeSinceFirstSample = time.Since(LatestPodRequest.Timestamp).Seconds()
108-
// SumPodRequest.Timestamp = time.Now()
111+
109112
log.Info(fmt.Sprint("Updating cache sample ", SumPodRequest.Sample))
110113

111114
for _, sumC := range SumPodRequest.ContainerRequests {

0 commit comments

Comments
 (0)