Skip to content

Commit 5c223e3

Browse files
dispensableCopilot
andauthored
Fix upyun 403 as not hit err (#14)
* Fix upyun 403 as not hit err Co-authored-by: Copilot <[email protected]> --------- Co-authored-by: mu <[email protected]> Co-authored-by: Copilot <[email protected]>
1 parent 350f0e9 commit 5c223e3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

exporter/exporter.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,8 @@ func (e *CdnExporter) Collect(ch chan<- prometheus.Metric) {
201201
)
202202

203203
for _, point := range cdnFlowDetailData {
204-
cdnHitRateTotal = cdnHitRateTotal + (float64(point.Hit) / float64(point.Reqs))
204+
// FIXME: upyun treats 403 as not hit
205+
cdnHitRateTotal = cdnHitRateTotal + (float64(point.Hit) + float64(point.Code403)) / float64(point.Reqs)
205206
cdnFlowHitRateTotal = cdnFlowHitRateTotal + (float64(point.HitBytes) / float64(point.Bytes))
206207
code200Total += point.Code200
207208
code206Total += point.Code206

0 commit comments

Comments
 (0)