XU XUv0.8.8
EN

API

#github.com/xulang-org/packages/prometheus

import: prometheus #github.com/xulang-org/packages/prometheus

counts: 7 函数, 17 方法, 7 类型, 0 常量, 0 方法集

扩展包 `prometheus #github.com/xulang-org/packages/prometheus`,由模块 github.com/xulang-org/packages 提供。

github.com/xulang-org/packages · 0.1.1 · 安装与使用

open_pusher

XuAPI
pub fn open_pusher(endpoint string, job string) Pusher

用途

打开pusher。

参数

endpoint string
endpoint(string)
job string
job(string)

返回

Pusher — 该类型的值

struct Label

XuAPI
pub struct Label {
    pub name string
    pub value string
}

用途

公开结构体 `Label`。

参数

name string
名字
value string
字段(string)

struct MetricSample

XuAPI
pub struct MetricSample {
    pub label_str string
    pub value string
}

用途

公开结构体 `MetricSample`。

参数

label_str string
字段(string)
value string
字段(string)

struct Counter

XuAPI
pub struct Counter {
    pub name string
    pub help string
    pub samples []MetricSample
}

用途

公开结构体 `Counter`。

参数

name string
名字
help string
字段(string)
samples []MetricSample
字段([]MetricSample)

struct Gauge

XuAPI
pub struct Gauge {
    pub name string
    pub help string
    pub samples []MetricSample
}

用途

公开结构体 `Gauge`。

参数

name string
名字
help string
字段(string)
samples []MetricSample
字段([]MetricSample)

new_counter

XuAPI
pub fn new_counter(name string, help string) Counter

用途

构造 counter。

参数

name string
名字(string)
help string
help(string)

返回

Counter — 该类型的值

new_gauge

XuAPI
pub fn new_gauge(name string, help string) Gauge

用途

构造 gauge。

参数

name string
名字(string)
help string
help(string)

返回

Gauge — 该类型的值

(&mut Counter) inc

XuAPI
pub fn (c &mut Counter) inc()

用途

在 `&mut Counter` 上调用 `inc`。

参数

c &mut Counter
接收者 &mut Counter(可变借用)

(&mut Counter) inc_by

XuAPI
pub fn (c &mut Counter) inc_by(delta int)

用途

`&mut Counter` 上的方法:inc按。

参数

c &mut Counter
接收者 &mut Counter(可变借用)
delta int
增量(int)

(&mut Counter) inc_labels

XuAPI
pub fn (c &mut Counter) inc_labels(labels []Label, delta int)

用途

`&mut Counter` 上的方法:inclabels。

参数

c &mut Counter
接收者 &mut Counter(可变借用)
labels []Label
labels([]Label)
delta int
增量(int)

(&mut Gauge) set

XuAPI
pub fn (g &mut Gauge) set(val string)

用途

在 `&mut Gauge` 上调用 `set`。

参数

g &mut Gauge
接收者 &mut Gauge(可变借用)
val string
值(string)

(&mut Gauge) set_labels

XuAPI
pub fn (g &mut Gauge) set_labels(labels []Label, val string)

用途

`&mut Gauge` 上的方法:设置 labels。

参数

g &mut Gauge
接收者 &mut Gauge(可变借用)
labels []Label
labels([]Label)
val string
值(string)

(Counter) format

XuAPI
pub fn (c Counter) format() string

用途

`Counter` 上的方法:格式化为字符串。

参数

c Counter
接收者 Counter(值接收者)

返回

string — 结果字符串

(Gauge) format

XuAPI
pub fn (g Gauge) format() string

用途

`Gauge` 上的方法:格式化为字符串。

参数

g Gauge
接收者 Gauge(值接收者)

返回

string — 结果字符串

struct Pool

XuAPI
pub struct Pool {
    pub host string
    pub port int
    pub state chan pool.State
    pub max_idle int
}

用途

公开结构体 `Pool`。

参数

host string
主机
port int
端口
state chan pool.State
字段(通道;类型 chan pool.State)
max_idle int
字段(int)

new_pool

XuAPI
pub fn new_pool(endpoint string, max_idle int) Pool

用途

构造 pool。

参数

endpoint string
endpoint(string)
max_idle int
max_idle(int)

返回

Pool — 该类型的值

open_pool

XuAPI
pub fn open_pool(endpoint string, max_idle int) Pool

用途

打开pool。

参数

endpoint string
endpoint(string)
max_idle int
max_idle(int)

返回

Pool — 该类型的值

(&Pool) dup

XuAPI
pub fn (p &Pool) dup() Pool

用途

在 `&Pool` 上调用 `dup`。

参数

p &Pool
接收者 &Pool(借用)

返回

Pool — 该类型的值

(&Pool) get_conn

XuAPI
pub fn (p &Pool) get_conn() int

用途

`&Pool` 上的方法:读取 conn。

参数

p &Pool
接收者 &Pool(借用)

返回

int — 该类型的值

(&Pool) put_conn

XuAPI
pub fn (p &Pool) put_conn(fd int)

用途

`&Pool` 上的方法:put连接。

参数

p &Pool
接收者 &Pool(借用)
fd int
文件描述符(int)

(&Pool) discard_conn

XuAPI
pub fn (p &Pool) discard_conn(fd int)

用途

`&Pool` 上的方法:丢弃连接。

参数

p &Pool
接收者 &Pool(借用)
fd int
文件描述符(int)

(&Pool) push_metrics

XuAPI
pub fn (p &Pool) push_metrics(job string, metrics_text string) bool

用途

`&Pool` 上的方法:压入metrics。

参数

p &Pool
接收者 &Pool(借用)
job string
job(string)
metrics_text string
metrics_text(string)

返回

bool — 是否成立

(&Pool) close

XuAPI
pub fn (p &Pool) close()

用途

`&Pool` 上的方法:关闭资源。

参数

p &Pool
接收者 &Pool(借用)

struct Pusher

XuAPI
pub struct Pusher {
    pub host string
    pub port int
    pub job string
}

用途

公开结构体 `Pusher`。

参数

host string
主机
port int
端口
job string
字段(string)

new_pusher

XuAPI
pub fn new_pusher(endpoint string, job string) Pusher

用途

构造 pusher。

参数

endpoint string
endpoint(string)
job string
job(string)

返回

Pusher — 该类型的值

(&Pusher) push

XuAPI
pub fn (p &Pusher) push(metrics_text string) bool

用途

`&Pusher` 上的方法:压入。

参数

p &Pusher
接收者 &Pusher(借用)
metrics_text string
metrics_text(string)

返回

bool — 是否成立

struct Registry

XuAPI
pub struct Registry {
    pub counters []Counter
    pub gauges []Gauge
}

用途

公开结构体 `Registry`。

参数

counters []Counter
字段([]Counter)
gauges []Gauge
字段([]Gauge)

new_registry

XuAPI
pub fn new_registry() Registry

用途

构造 registry。

参数

无

返回

Registry — 该类型的值

(&mut Registry) register_counter

XuAPI
pub fn (r &mut Registry) register_counter(c Counter)

用途

`&mut Registry` 上的方法:registercounter。

参数

r &mut Registry
接收者 &mut Registry(可变借用)
c Counter
字节或字符码(Counter)

(&mut Registry) register_gauge

XuAPI
pub fn (r &mut Registry) register_gauge(g Gauge)

用途

`&mut Registry` 上的方法:registergauge。

参数

r &mut Registry
接收者 &mut Registry(可变借用)
g Gauge
g(Gauge)

(&Registry) gather

XuAPI
pub fn (r &Registry) gather() string

用途

在 `&Registry` 上调用 `gather`。

参数

r &Registry
接收者 &Registry(借用)

返回

string — 结果字符串