poxet / Influx-Capacitor

Influx-capacitor collects metrics from windows machines using Performance Counters. Data is sent to influxDB to be viewable by grafana.
http://influx-capacitor.com
MIT License
44 stars 13 forks source link

Types of allowed databases #45

Closed marcelopetersen closed 8 years ago

marcelopetersen commented 8 years ago

Hello,

looking at the source code, in the ConfigBusiness class, has no swtich option to influxdb (actually is empty). That will be default behavior or is a typo error?

namespace Tharga.InfluxCapacitor.Collector.Business { private static IEnumerable GetDatabaseConfig(XmlDocument document) { var databases = document.GetElementsByTagName("Database");
foreach (XmlNode database in databases) { var databaseType = GetDatabaseType(database); switch (databaseType) { case "null": yield return GetNullDatabaseConfig(database); break; case "acc": yield return GetAccDatabaseConfig(database); break; case "kafka": yield return GetKafkaDatabaseConfig(database); break; case "": yield return GetInfluxDatabaseConfig(database); break; default: throw new ArgumentOutOfRangeException(string.Format("There is no database type with name {0}.", databaseType)); } } } }

poxet commented 8 years ago

This was initially for backwords compatibility.

The first version was always influx, therefore the type setting did not exist, so empty string was influxDB. This is the default behaviour.

When I check the help file, it reads that the type should be "InfluxDB", so there is a bug hidden there.

It should be both "" and "InfluxDB" in the switch...

case "InfluxDB": case "": //For backwards compatibility yield return GetInfluxDatabaseConfig(database); break;