Skip to content

Commit

Permalink
fix(metrics): include protocol in string
Browse files Browse the repository at this point in the history
  • Loading branch information
coderbyheart committed Jul 31, 2024
1 parent e4befbf commit 489a542
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,10 @@ jobs:
run: |
cat *-coap-*.log > all-coap.log
cat all-coap.log
grep -E "^20[0-9]{2}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}+[^,]+,dTLS:udp6,request$" all-coap.log
grep -E "^20[0-9]{2}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}+[^,]+,UDP:udp6,request$" all-coap.log
grep -E "^20[0-9]{2}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}+[^,]+,dTLS:udp4,request$" all-coap.log
grep -E "^20[0-9]{2}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}+[^,]+,UDP:udp4,request$" all-coap.log
grep -E "^20[0-9]{2}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}+[^,]+,coap:dTLS:udp6,request$" all-coap.log
grep -E "^20[0-9]{2}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}+[^,]+,coap:UDP:udp6,request$" all-coap.log
grep -E "^20[0-9]{2}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}+[^,]+,coap:dTLS:udp4,request$" all-coap.log
grep -E "^20[0-9]{2}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}+[^,]+,coap:UDP:udp4,request$" all-coap.log
- uses: actions/upload-artifact@v4
with:
Expand Down
2 changes: 1 addition & 1 deletion server/internal/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ func logMetrics (dtls bool, network string) func (next mux.Handler) mux.Handler
} else {
protocol = "UDP"
}
metricLog := fmt.Sprintf("%s,%s:%s,request", currentTime, protocol, network)
metricLog := fmt.Sprintf("%s,coap:%s:%s,request", currentTime, protocol, network)
metricLogsFilePath := fmt.Sprintf("/var/log/academy/%s-coap-%s-%s.log", time.Now().Format("2006-01-02"), protocol, network)
metricLogsFile, err := os.OpenFile(metricLogsFilePath, os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644)
if err != nil {
Expand Down

0 comments on commit 489a542

Please sign in to comment.