Skip to content

Commit 4950e76

Browse files
committed
monitoring : Fix for cluster statistics push to db
When bigfin attempts to call skyring's module, since the call is in context of bigfin, the configuration used is also in the context of bigfin. So, it becomes necessary to pass the required configuration values from bigfin.This patch alters the framework to accept the values of required configurations from the provider along with the values to push to db. Change-Id: I4d373f451fe619aae4e22f4a2306f0b42c7739a3 Signed-off-by: anmolbabu <[email protected]>
1 parent dbf8bb5 commit 4950e76

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

monitoring/graphitemanager/graphite_manager.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ func (tsdbm GraphiteManager) QueryDB(params map[string]interface{}) (interface{}
199199
}
200200

201201
//This method takes map[string]map[string]string ==> map[metric/table name]map[timestamp]value
202-
func (tsdbm GraphiteManager) PushToDb(metrics map[string]map[string]string) error {
202+
func (tsdbm GraphiteManager) PushToDb(metrics map[string]map[string]string, hostName string, port int) error {
203203
data := make([]graphite.Metric, 1)
204204
for tableName, valueMap := range metrics {
205205
for timestamp, value := range valueMap {
@@ -210,7 +210,7 @@ func (tsdbm GraphiteManager) PushToDb(metrics map[string]map[string]string) erro
210210
data = append(data, graphite.Metric{Name: tableName, Value: value, Timestamp: timeInt})
211211
}
212212
}
213-
Graphite, err := graphite.NewGraphite(conf.SystemConfig.TimeSeriesDBConfig.Hostname, conf.SystemConfig.TimeSeriesDBConfig.DataPushPort)
213+
Graphite, err := graphite.NewGraphite(hostName, port)
214214
if err != nil {
215215
return fmt.Errorf("%v", err)
216216
}

monitoring/influxdbmanager/influxdb_manager.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ func (idm InfluxdbManager) QueryDB(params map[string]interface{}) (interface{},
9696
return res, err
9797
}
9898

99-
func (idm InfluxdbManager) PushToDb(metrics map[string]map[string]string) error {
99+
func (idm InfluxdbManager) PushToDb(metrics map[string]map[string]string, hostName string, port int) error {
100100
/*
101101
TODO Implement
102102
*/

monitoring/interfaces.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ package monitoring
22

33
type MonitoringManagerInterface interface {
44
QueryDB(params map[string]interface{}) (interface{}, error)
5-
PushToDb(metrics map[string]map[string]string) error
5+
PushToDb(metrics map[string]map[string]string, hostName string, port int) error
66
}

0 commit comments

Comments
 (0)