From a3a1295992ef77bc6f5c367495644c090cfabd54 Mon Sep 17 00:00:00 2001 From: nixargh Date: Thu, 3 Jun 2021 21:32:27 +0300 Subject: [PATCH] v1.3.0 --- CHANGELOG.md | 8 ++++++-- main.go | 9 ++++++--- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 14f8083..804a5bc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,11 +4,15 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). -## [1.2.1] +## [1.3.0] - 2021-06-03 +### Added +- **hostname** argument. Allows setting hostname instead of getting a real one (good for Docker). + +## [1.2.1] - 2021-02-28 ### Fxied - Wait time when no metrics are in the queue from **10** to **5** milliseconds. -## [1.2.0] +## [1.2.0] - 2021-02-28 ### Changed - The size of a pack from **1000** to **10000**. Default packs limit adjusted as well. diff --git a/main.go b/main.go index 68de9f9..41cd9df 100644 --- a/main.go +++ b/main.go @@ -20,7 +20,7 @@ import ( // "github.com/pkg/profile" ) -var version string = "1.2.1" +var version string = "1.3.0" var clog, slog, rlog, tlog, stlog *log.Entry var hostname string @@ -484,6 +484,7 @@ func main() { flag.IntVar(&limitPerSec, "limitPerSec", 2, "Maximum number of metric packs (<=10000 metrics per pack) sent per second") flag.StringVar(&systemTenant, "systemTenant", "", "Graphite project name to store SELF metrics in. By default is equal to 'tennant'") flag.StringVar(&systemPrefix, "systemPrefix", "", "Prefix to add to any SELF metric. By default is equal to 'prefix'") + flag.StringVar(&hostname, "hostname", "", "Hostname of a computer running Groxy") flag.Parse() @@ -529,11 +530,13 @@ func main() { systemPrefix = prefix } + if hostname == "" { + hostname = getHostname() + } + inputChan := make(chan *Metric, 10000000) outputChan := make(chan *Metric, 10000000) - hostname = getHostname() - go runReceiver(address, port, inputChan) go runTransformer(inputChan, outputChan, tenant, prefix, immutablePrefix) go runSender(graphiteAddress, graphitePort, outputChan, TLS, ignoreCert, limitPerSec)