Skip to content

Commit 4c8437f

Browse files
Add goturbo/cpu endpoint to simulate going turbo wrt CPU
https://youtu.be/TNjAZZ3vQ8o?t=14' for more context on 'Going Turbo'
1 parent 6aeb07d commit 4c8437f

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

pkg/handler/handler.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,3 +143,15 @@ func GoTurboMemory(c *gin.Context) {
143143
}()
144144
c.JSON(200, gin.H{"status": "success"})
145145
}
146+
147+
// GoTurboCPU will make dobby go Turbo
148+
// Watch the video `https://youtu.be/TNjAZZ3vQ8o?t=14`
149+
// for more context on `Going Turbo`
150+
func GoTurboCPU(c *gin.Context) {
151+
go func() {
152+
for {
153+
_ = 0
154+
}
155+
}()
156+
c.JSON(200, gin.H{"status": "success"})
157+
}

pkg/server/server.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ func Bind(root *gin.Engine, server *http.Server, initialHealth, initialReadiness
3737
controlGroup.PUT("/ready/perfect", h.MakeReadyPerfect)
3838
controlGroup.PUT("/ready/sick", h.MakeReadySick)
3939
controlGroup.PUT("/goturbo/memory", handler.GoTurboMemory)
40+
controlGroup.PUT("/goturbo/cpu", handler.GoTurboCPU)
4041
controlGroup.PUT("/crash", handler.Crash(server))
4142
}
4243
}

0 commit comments

Comments
 (0)