chrdsclient

package module
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2024 License: GPL-3.0 Imports: 7 Imported by: 0

README

Charybdis Monitoring System client module

The client module provides a set of functions for transferring metrics and logs to the monitoring system.

Example

package main

import (
    "log"
    "github.com/DemianSV/chrdsclient"
)

func main() {
    chrdsclient.Conf.SpaceID = "SPACEID"
    chrdsclient.Conf.ModulID = "MODULID"
    chrdsclient.Conf.DataManagerURL = []string{"https://DATAMANAGERURL01", "https://DATAMANAGERURL02"}
    chrdsclient.Conf.DataManagerTimeOut = 1 // Connect DataManager timeout = 1 second
    chrdsclient.Conf.ClientInSecureSkipVerify = true


    err := chrdsclient.Log("log", "Test test test") // Parameter 1: Metric name, Parameter 2: Value (string).
    if err != nil {
        log.Print(err)
    }

    err := chrdsclient.Metric("test", float32(200)) // Parameter 1: Metric name, Parameter 2: Value (float32).
    if err != nil {
        log.Print(err)
    }
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Log

func Log(metric string, value string) error

func MakeTimestamp

func MakeTimestamp() int64

func Metric

func Metric(metric string, value float32) error

func Status

func Status() []bool

Types

type ConfT

type ConfT struct {
	ClientInSecureSkipVerify bool
	SpaceID                  string
	ModuleID                 string
	DataManagerURL           []string // DataManager URL, array
	DataManagerTimeOut       int      // Connect DataManager timeout, default 1 second
}
var Conf ConfT

Jump to

Keyboard shortcuts

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