Documentation
¶
Index ¶
Constants ¶
const ( HTTPMultipartSessionsName = "http_multipart_sessions" HTTPMultipartMessagesReceivedName = "http_multipart_msgs_received" HTTPMultipartSessionDurationName = "http_multipart_session_duration" )
Variables ¶
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
Logger logrus.FieldLogger
// contains filtered or unexported fields
}
Client is the representation of the sse returned to the js.
type HTTPMultipartMetrics ¶
type HTTPMultipartMetrics struct {
// Websocket-related
HTTPMultipartSessions *metrics.Metric
HTTPMultipartMessagesReceived *metrics.Metric
HTTPMultipartSessionDuration *metrics.Metric
}
BuiltinMetrics represent all the builtin metrics of k6
func RegisterMetrics ¶
func RegisterMetrics(registry *metrics.Registry) *HTTPMultipartMetrics
RegisterMetrics register and returns the builtin metrics in the provided registry
type InternalState ¶
type InternalState struct {
ActiveVUs int64 `js:"activeVUs"`
Iteration int64
VUID uint64 `js:"vuID"`
VUIDFromRuntime sobek.Value `js:"vuIDFromRuntime"`
}
InternalState holds basic metadata from the runtime state.
type MultipartSubscription ¶
type MultipartSubscription struct {
// contains filtered or unexported fields
}
MultipartSubscription represents an instance of the JS module for every VU.
type MultipartSubscriptionAPI ¶
type MultipartSubscriptionAPI struct {
// contains filtered or unexported fields
}
func (*MultipartSubscriptionAPI) Exports ¶
func (r *MultipartSubscriptionAPI) Exports() modules.Exports
Exports implements the modules.Instance interface and returns the exported types for the JS module.
func (*MultipartSubscriptionAPI) GetInternalState ¶
func (r *MultipartSubscriptionAPI) GetInternalState() *InternalState
GetInternalState interrogates the current virtual user for state information.
type ObjectHolder ¶ added in v0.0.2
type ObjectHolder struct {
// contains filtered or unexported fields
}
Hold MultipartSubscription JS objects so they don't get GC'd until Closed
type Parser ¶ added in v0.0.2
type Parser struct {
// contains filtered or unexported fields
}
Parser handles parsing of multipart/mixed content according to RFC 1341
type Part ¶ added in v0.0.2
type Part struct {
Header textproto.MIMEHeader
Body []byte
}
Part represents a single part in a multipart message
func (*Part) GetContentDisposition ¶ added in v0.0.2
GetContentDisposition returns the Content-Disposition header value for a part
func (*Part) GetContentType ¶ added in v0.0.2
GetContentType returns the Content-Type header value for a part
type ReadyState ¶
type ReadyState uint8
const ( // CONNECTING is the state while the web socket is connecting CONNECTING ReadyState = iota // OPEN is the state after the connection is established and before it starts closing OPEN // CLOSING is while the connection is closing but is *not* closed yet CLOSING // CLOSED is when the connection is finally closed CLOSED )
type RootModule ¶
type RootModule struct{}
RootModule is the global module instance that will create module instances for each VU.
func (*RootModule) NewModuleInstance ¶
func (*RootModule) NewModuleInstance(vu modules.VU) modules.Instance
NewMultipartSubscription implements the modules.Module interface returning a new instance for each VU.