stats

package
v2.22.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 17, 2025 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HTTPStats

type HTTPStats struct {
	ClientOptions http.ClientOptions
	// contains filtered or unexported fields
}

func (*HTTPStats) PostJobRun

func (stat *HTTPStats) PostJobRun(deal *data.DealContainer) error

func (*HTTPStats) PostReputation

func (stat *HTTPStats) PostReputation(address string, reputation Reputation) error

type JobRun

type JobRun struct {
	DealID                        string          `json:"dealId"`
	ModuleID                      string          `json:"moduleId"`
	JobCreator                    string          `json:"jobCreator"`
	ResourceProvider              string          `json:"resourceProvider"`
	JobOffer                      string          `json:"jobOffer"`
	ResourceOffer                 string          `json:"resourceOffer"`
	JobState                      string          `json:"jobState"`
	MatchDurationMilliseconds     float64         `json:"matchDuration_ms"`
	ExecutionDurationMilliseconds float64         `json:"executionDuration_ms"`
	RetrievalDurationMilliseconds float64         `json:"retrievalDuration_ms"`
	TotalDurationMilliseconds     float64         `json:"totalDuration_ms"`
	ExtraData                     json.RawMessage `json:"extraData"`
}

type NoopStats

type NoopStats struct{}

func (*NoopStats) PostJobRun

func (stat *NoopStats) PostJobRun(deal *data.DealContainer) error

func (*NoopStats) PostReputation

func (stat *NoopStats) PostReputation(address string, reputation Reputation) error

type Reputation

type Reputation struct {
	JobMatched               *bool  `json:"job_matched"`
	JobCompletedNoValidation *bool  `json:"job_completed_no_validation"`
	ValidationLost           *bool  `json:"validation_lost"`
	RuntimeMillis            *int64 `json:"runtime_millis"`
	ModuleID                 string `json:"module_id"`
	JobFailed                *bool  `json:"job_failed"`
}

type ReputationBuilder

type ReputationBuilder struct {
	// contains filtered or unexported fields
}

The reputation builder constructs reputation from reputation events. For now, it does not expose runtime millis or module ID.

func NewReputationBuilder

func NewReputationBuilder() *ReputationBuilder

func (*ReputationBuilder) Build

func (b *ReputationBuilder) Build() Reputation

func (*ReputationBuilder) WithJobCompletedNoValidation

func (b *ReputationBuilder) WithJobCompletedNoValidation(val bool) *ReputationBuilder

func (*ReputationBuilder) WithJobFailed

func (b *ReputationBuilder) WithJobFailed(val bool) *ReputationBuilder

func (*ReputationBuilder) WithJobMatched

func (b *ReputationBuilder) WithJobMatched(val bool) *ReputationBuilder

func (*ReputationBuilder) WithValidationLost

func (b *ReputationBuilder) WithValidationLost(val bool) *ReputationBuilder

type Stats

type Stats interface {
	PostJobRun(deal *data.DealContainer) error
	PostReputation(address string, reputation Reputation) error
}

func NewStats

func NewStats(service system.Service, options StatsOptions, web3Options web3.Web3Options, web3SDK *web3.Web3SDK) (Stats, error)

type StatsOptions

type StatsOptions struct {
	Enabled bool
	URL     string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL