application

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2018 License: MIT Imports: 33 Imported by: 0

Documentation

Index

Constants

View Source
const (
	VERSION                  = "0.2.0"
	METRICKEY                = "NNDOBIXNSfWeKjE7TSyvPbgAFHXL6xSR"
	METRICSERVER             = "http://localhost:5003"
	DBPATH                   = "data.db"
	PORT                     = 1323
	TIMERINVENTORY           = 1
	TIMERINVENTORYSUBMISSION = 1
	TIMEROUT                 = 10
	TIMEREGENERATION         = 5
	TIMERREGENERATEINDEX     = time.Duration(TIMEREGENERATION) * time.Minute
	TIMERGATHERSTAT          = time.Duration(TIMERINVENTORY) * time.Minute
	TIMERSUBMITMETRICS       = time.Duration(2) * time.Minute //time.Duration(TIMERINVENTORYSUBMISSION) * time.Hour
	DATAOUTPUTFOLDER         = "output/"
)

Variables

This section is empty.

Functions

func Encrypt

func Encrypt(key, text []byte) string

func NewAssets

func NewAssets(root string) *assetfs.AssetFS

Types

type Application

type Application struct {
	Versions  version
	HX        *hxconnect.Connection
	Logger    *logrus.Logger
	Server    *echo.Echo
	LastError error
	Flags     *flags
	Crons     *cron.Cron
	Port      int
	StartTime int64
	Stats     Stat
	Checkers  Checks
	// contains filtered or unexported fields
}

func GetInstance

func GetInstance() *Application

func New

func New() *Application

func (*Application) DEBUGOverrideLocalHXServer

func (a *Application) DEBUGOverrideLocalHXServer(server string)

func (*Application) GetServerPort

func (a *Application) GetServerPort() string

func (*Application) SetServerPort

func (a *Application) SetServerPort(port int)

func (*Application) Start

func (a *Application) Start()

func (*Application) Stop

func (a *Application) Stop()

type Checks

type Checks struct {
	URLS    health.CompositeChecker
	Handler health.Handler
}

type MetricAbout

type MetricAbout struct {
	Build    string
	DVersion string
	Instance string
	Locale   string
	Version  string
}

type MetricData

type MetricData struct {
	CollectionTime           time.Time
	CollectionDuration       string
	Submitted                bool
	SubmittedOn              time.Time
	SubmittedTransactionCode string
	About                    *MetricAbout
	Info                     *[]MetricInfo
	Savings                  *MetricSavings
	Platform                 *MetricPlatform
	Datastores               *MetricDatastores
	Nodes                    *MetricNodes
	VM                       *MetricVirtualMachines
	Summary                  *MetricSummary
}

type MetricDatastore

type MetricDatastore struct {
	DatastoreID                         string
	DatastoreType                       string
	DatastoreName                       string
	DatastoreVirtualName                string
	DatastoreCapacity                   int64
	DatastoreNumMirrors                 int
	DatastoreCreationTime               int64
	DatastoreFreeCapacity               int64
	DatastoreUnsharedBytes              int64
	DatastoreUncompressedBytes          int64
	DatastoreVirtualMountSummary        bool
	DatastoreVirtualAccessibleSummary   bool
	DatastoreReplicationDatastorePaired bool
}

type MetricDatastores

type MetricDatastores struct {
	DS                *[]MetricDatastore
	DatastoreCount    int
	TotalCapacity     int64
	TotalFreeCapacuty int64
	TotalMounted      int
	TotalAccessible   int
	TotalReplicated   int
}

type MetricInfo

type MetricInfo struct {
	ClusterName        string
	VcenterDCName      string
	VcenterClusterName string
	UCSMOrgName        string
	ClusterState       string

	ClusterNodeSize      int
	ClusterNodesActive   int
	ClusterModelNumbers  string
	ClusterSerialNumbers string
	ClusterUpgradeState  string

	ClusterUptime       string
	ClusterBootTime     time.Time
	ClusterRawCapacity  float64
	ClusterCapacity     float64
	ClusterUsedCapacity float64
	ClusterFreeCapacity float64

	ClusterDowntime float64
	ClusterAllFlash bool
	ClusterRF       int
	ClusterPolicy   string
}

type MetricNode

type MetricNode struct {
	NodeID                 string
	NodeName               string
	NodePosition           string
	NodeFullName           string
	NodeVersion            int
	NodeBuild              string
	NodeBuildName          string
	NodeDiskCount          int
	NodeOSVersion          string
	NodeOSName             string
	NodeSerial             string
	NodeOSBuild            string
	NodeStatus             string
	NodeType               string
	NodeSize               int
	NodePhyNic             int
	NodeCompressionSavings float64
	NodeDedupSavings       float64
	NodeTotalSavings       float64
}

type MetricNodes

type MetricNodes struct {
	NodeCount int
	Nodes     *[]MetricNode
}

type MetricPlatform

type MetricPlatform struct {
	EffectiveCPU    int64
	EffectiveMemory int64
	TotalCPU        int64
	TotalMemory     int64
	OverallStatus   string
	EffectiveCores  int64
}

type MetricSavings

type MetricSavings struct {
	ClusterCompressionSavings float64
	ClusterDedupSavings       float64
	ClusterTotalSavings       float64
}

type MetricSummary

type MetricSummary struct {
	ReplicationCompliance string
	SpaceStatus           string
	TotalCapacity         int64
	UsedCapacity          int64
	FreeCapacity          int64
	CompressionSavings    float64
	DeduplicationSavings  float64
	TotalSavings          float64
	ZoneType              int
	NumZones              int
	HealthState           string
	HealthMessage         string
}

type MetricVirtualMachine

type MetricVirtualMachine struct {
	Group             string
	PathName          string
	PowerState        bool
	MemoryUsage       int64
	StorageUncommited int64
	OverallCPUUsage   int64
	IPAddress         string
	GuestOS           string
	GuestID           string
	ConnectionState   bool
	Version           string
	CPUNumber         int
	InstanceID        string
	MemoryMB          int64
	GuestState        bool
	StorageCommitted  int64
	Name              string
	Host              string
	ID                string
	FullName          string
	UUID              string
	ResourcePool      string
}

type MetricVirtualMachines

type MetricVirtualMachines struct {
	VMs               *[]MetricVirtualMachine
	VMCount           int
	PoweredOn         int
	MemoryUsage       int64
	OverrallCPUUsage  int64
	ConnectedCount    int
	CommittedCPU      int
	CommittedMemory   int64
	StorageUncommited int64
	StorageCommitted  int64
}

type Stat

type Stat struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func (*Stat) GetCounter

func (s *Stat) GetCounter(key string) int64

func (*Stat) IncreaseCounter

func (s *Stat) IncreaseCounter(key string) int64

type TaskCounter

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

type Template

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

Template is custom renderer for Echo, to render html from bindata

func NewTemplate

func NewTemplate() *Template

NewTemplate creates a new template

func (*Template) Render

func (t *Template) Render(w io.Writer, name string, data interface{}, c echo.Context) error

Render renders template

Jump to

Keyboard shortcuts

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