monitoring/graphitemanager/graphite_manager.go
func (tsdbm GraphiteManager) PushToDb(metrics map[string]map[string]string, hostName string, port int) error {
	data := make([]graphite.Metric, 1)
	for tableName, valueMap := range metrics {
		for timestamp, value := range valueMap {
			timeInt, err := strconv.ParseInt(timestamp, 10, 64)
			if err != nil {
				return fmt.Errorf("Failed to parse timestamp %v of metric tableName %v.Error: %v", timestamp, tableName, err.Error())
			}
			data = append(data, graphite.Metric{Name: tableName, Value: value, Timestamp: timeInt})
		}
	}
	Graphite, err := graphite.NewGraphite(hostName, port)
	if err != nil {
		return fmt.Errorf("%v", err)
	}
	Graphite.SendMetrics(data)
	if err := Graphite.Disconnect(); err != nil {
		logger.Get().Warning("Failed to disconnect the graphite conn.Error %v", err)
	}
	return nil
}
func (tsdbm GraphiteManager) PushToDb(metrics map[string]map[string]string, hostName string, port int) error {
	data := make([]graphite.Metric, 1)
	for tableName, valueMap := range metrics {
		for timestamp, value := range valueMap {
			timeInt, err := strconv.ParseInt(timestamp, 10, 64)
			if err != nil {
				return fmt.Errorf("Failed to parse timestamp %v of metric tableName %v.Error: %v", timestamp, tableName, err.Error())
			}
			data = append(data, graphite.Metric{Name: tableName, Value: value, Timestamp: timeInt})
		}
	}
	Graphite, err := graphite.NewGraphite(hostName, port)
	if err != nil {
		return fmt.Errorf("%v", err)
	}
	Graphite.SendMetrics(data)
	if err := Graphite.Disconnect(); err != nil {
		logger.Get().Warning("Failed to disconnect the graphite conn.Error %v", err)
	}
	return nil
}
//This method takes map[string]map[string]string ==> map[metric/table name]map[timestamp]value