analytics

package
v0.3.6 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2026 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// Component
	AnalyticsComponent  Component = "analytics"
	GasStationComponent Component = "gas station"
	L1NodeComponent     Component = "l1 node"
	RollupComponent     Component = "rollup"
	OPinitComponent     Component = "opinit"
	RelayerComponent    Component = "relayer"
	UpgradeComponent    Component = "upgrade"

	// EventKeys
	ComponentEventKey  string = "component"
	FeatureEventKey    string = "feature"
	CommandEventKey    string = "command"
	OptionEventKey     string = "option"
	L1ChainIdEventKey  string = "l1_chain_id"
	ErrorEventKey      string = "panic_error"
	ModelNameKey       string = "model_name"
	GenerateKeyfileKey string = "generate_key_file"
	KeyFileKey         string = "key_file"
	WithConfigKey      string = "with_config"
	VmKey              string = "vm"
	BotTypeKey         string = "bot_type"

	// Event
	RunEvent       Event = "run"
	CompletedEvent Event = "completed"

	// Init Event
	InitActionSelected             Event = "init_action_selected"
	ExistingAppReplaceSelected     Event = "existing_app_replace_selected"
	L1NetworkSelected              Event = "l1_network_selected"
	Interrupted                    Event = "interrupted"
	Panicked                       Event = "panicked"
	L1NodeVersionSelected          Event = "l1_node_version_selected"
	PruningStrategySelected        Event = "pruning_strategy_selected"
	ExistingGenesisReplaceSelected Event = "existing_genesis_replace_selected"
	SyncMethodSelected             Event = "sync_method_selected"
	CosmovisorAutoUpgradeSelected  Event = "cosmovisor_auto_upgrade_selected"
	ExistingDataReplaceSelected    Event = "existing_data_replace_selected"
	FeaturesEnabled                Event = "feature_enabled"

	// Rollup Event
	VmTypeSelected                        Event = "vm_type_selected"
	OpBridgeBatchSubmissionTargetSelected Event = "op_bridge_batch_submission_selected"
	EnableOracleSelected                  Event = "enable_oracle_selected"
	SystemKeysSelected                    Event = "system_keys_selected"
	AccountsFundingPresetSelected         Event = "accounts_funding_preset_selected"
	AddGasStationToGenesisSelected        Event = "add_gas_station_to_genesis_selected"
	AddGenesisAccountsSelected            Event = "add_genesis_accounts_selected"

	// Opinit Event
	OPInitBotInitSelected           Event = "opinit_bot_init_selected"
	ResetDBSelected                 Event = "reset_db_selected"
	UseCurrentConfigSelected        Event = "use_current_config_selected"
	PrefillFromArtifactsSelected    Event = "prefill_from_artifacts_selected"
	L1PrefillSelected               Event = "l1_prefill_selected"
	DALayerSelected                 Event = "da_layer_selected"
	ImportKeysFromArtifactsSelected Event = "import_keys_from_artifacts_selected"
	RecoverKeySelected              Event = "recover_key_selected"

	// Relayer
	RelayerRollupSelected              Event = "relayer_rollup_selected"
	RelayerL2Selected                  Event = "relayer_l2_selected"
	SettingUpIBCChannelsMethodSelected Event = "setting_up_ibc_channels_method_selected"
	IBCChannelsSelected                Event = "ibc_channel_selected"
	UseChallengerKeySelected           Event = "use_challenger_key_selected"

	// GasStation
	GasStationMethodSelected Event = "gas_station_method_selected"
)

Variables

View Source
var (
	Client                amplitude.Client
	SessionID             int64
	GlobalEventProperties map[string]interface{}
)
View Source
var (
	AmplitudeKey = "2f88e103ec6463ae4af81f0ef6c16c09"
)

Functions

func AppendGlobalEventProperties

func AppendGlobalEventProperties(properties EventAttributes)

func Initialize

func Initialize(weaveVersion string)

func TrackCompletedEvent

func TrackCompletedEvent(feature Feature)

func TrackEvent

func TrackEvent(eventType Event, overrideProperties *AmplitudeEvent)

func TrackRunEvent

func TrackRunEvent(cmd *cobra.Command, args []string, feature Feature, events *AmplitudeEvent)

Types

type AmplitudeEvent

type AmplitudeEvent struct {
	Attributes EventAttributes
}

AmplitudeEvent represents an event with some attributes

func NewEmptyEvent

func NewEmptyEvent() *AmplitudeEvent

NewEmptyEvent creates and returns an empty event

func (*AmplitudeEvent) Add

func (e *AmplitudeEvent) Add(key string, value interface{}) *AmplitudeEvent

Add adds a key-value pair to the event's attributes

type Component

type Component string

type Event

type Event string

type EventAttributes

type EventAttributes map[string]interface{}

type Feature

type Feature struct {
	Name      string
	Component Component
}
var (
	SetupL1NodeFeature     Feature = Feature{Name: "setup l1 node", Component: L1NodeComponent}
	RollupLaunchFeature    Feature = Feature{Name: "launch rollup", Component: RollupComponent}
	SetupOPinitBotFeature  Feature = Feature{Name: "setup opinit bot", Component: OPinitComponent}
	SetupOPinitKeysFeature Feature = Feature{Name: "setup opinit keys", Component: OPinitComponent}
	ResetOPinitBotFeature  Feature = Feature{Name: "reset opinit bot", Component: OPinitComponent}
	SetupGasStationFeature Feature = Feature{Name: "setup gas station", Component: GasStationComponent}
	SetupRelayerFeature    Feature = Feature{Name: "setup relayer", Component: RelayerComponent}
	OptOutAnalyticsFeature Feature = Feature{Name: "opt-out analytics", Component: AnalyticsComponent}
)

type NoOpClient

type NoOpClient struct{}

NoOpClient is a no-op implementation of the amplitude.Client interface

func (*NoOpClient) Add

func (n *NoOpClient) Add(plugin amplitude.Plugin)

Add does nothing in the NoOpClient

func (*NoOpClient) Config

func (n *NoOpClient) Config() amplitude.Config

Config returns an empty Config in the NoOpClient

func (*NoOpClient) Flush

func (n *NoOpClient) Flush()

Flush does nothing in the NoOpClient

func (*NoOpClient) GroupIdentify

func (n *NoOpClient) GroupIdentify(groupType string, groupName string, identify amplitude.Identify, eventOptions amplitude.EventOptions)

GroupIdentify does nothing in the NoOpClient

func (*NoOpClient) Identify

func (n *NoOpClient) Identify(identify amplitude.Identify, eventOptions amplitude.EventOptions)

Identify does nothing in the NoOpClient

func (*NoOpClient) Remove

func (n *NoOpClient) Remove(pluginName string)

Remove does nothing in the NoOpClient

func (*NoOpClient) Revenue

func (n *NoOpClient) Revenue(revenue amplitude.Revenue, eventOptions amplitude.EventOptions)

Revenue does nothing in the NoOpClient

func (*NoOpClient) SetGroup

func (n *NoOpClient) SetGroup(groupType string, groupName []string, eventOptions amplitude.EventOptions)

SetGroup does nothing in the NoOpClient

func (*NoOpClient) Shutdown

func (n *NoOpClient) Shutdown()

Shutdown does nothing in the NoOpClient

func (*NoOpClient) Track

func (n *NoOpClient) Track(event amplitude.Event)

Track does nothing in the NoOpClient

Jump to

Keyboard shortcuts

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