* wip * merge * working again * refactor/make it a bit cleaner * fix to only call cb for session id who initiated the event * support broadcasting events to all clients * refactor * refactor into ws extension * add go mod * rename module * fix naming * refactor * rename * merge * fix manager ws delete, add manager tests * add metric page * fixes, add k6 script * fixes, add k6 script * deploy docker image * cleanup * cleanup * cleanup
19 lines
379 B
Go
19 lines
379 B
Go
package ws
|
|
|
|
import (
|
|
"github.com/maddalax/htmgo/extensions/websocket/internal/wsutil"
|
|
"github.com/maddalax/htmgo/framework/h"
|
|
)
|
|
|
|
type Metrics struct {
|
|
Manager wsutil.ManagerMetrics
|
|
Handler HandlerMetrics
|
|
}
|
|
|
|
func MetricsFromCtx(ctx *h.RequestContext) Metrics {
|
|
manager := ManagerFromCtx(ctx)
|
|
return Metrics{
|
|
Manager: manager.Metrics(),
|
|
Handler: GetHandlerMetics(),
|
|
}
|
|
}
|