carbon/config.go
func NewConfig() *Config {
	cfg := &Config{
		Common: commonConfig{
			GraphPrefix: "carbon.agents.{host}",
			MetricInterval: &Duration{
				Duration: time.Minute,
			},
			MetricEndpoint: MetricEndpointLocal,
			MaxCPU:         1,
			User:           "carbon",
		},
		Whisper: whisperConfig{
			DataDir:             "/var/lib/graphite/whisper/",
			SchemasFilename:     "/etc/go-carbon/storage-schemas.conf",
			AggregationFilename: "",
			MaxUpdatesPerSecond: 0,
			Enabled:             true,
			Workers:             1,
			Sparse:              false,
			FLock:               false,
			HashFilenames:       true,
		},
		Cache: cacheConfig{
			MaxSize:       1000000,
			WriteStrategy: "max",
		},
		Udp:    udp.NewOptions(),
		Tcp:    tcp.NewOptions(),
		Pickle: tcp.NewFramingOptions(),
		Carbonserver: carbonserverConfig{
			Listen:            "127.0.0.1:8080",
			Enabled:           false,
			Buckets:           10,
			MaxGlobs:          100,
			FailOnMaxGlobs:    false,
			MetricsAsCounters: false,
			ScanFrequency: &Duration{
				Duration: 300 * time.Second,
			},
			ReadTimeout: &Duration{
				Duration: 60 * time.Second,
			},
			IdleTimeout: &Duration{
				Duration: 60 * time.Second,
			},
			WriteTimeout: &Duration{
				Duration: 60 * time.Second,
			},
			QueryCacheEnabled: true,
			QueryCacheSizeMB:  0,
			FindCacheEnabled:  true,
			TrigramIndex:      true,
		},
		Carbonlink: carbonlinkConfig{
			Listen:  "127.0.0.1:7002",
			Enabled: true,
			ReadTimeout: &Duration{
				Duration: 30 * time.Second,
			},
		},
		Grpc: grpcConfig{
			Listen:  "127.0.0.1:7003",
			Enabled: true,
		},
		Tags: tagsConfig{
			Enabled: false,
			TagDB:   "http://127.0.0.1:8000",
			TagDBTimeout: &Duration{
				Duration: time.Second,
			},
			TagDBChunkSize:      32,
			TagDBUpdateInterval: 100,
			LocalDir:            "/var/lib/graphite/tagging/",
		},
		Pprof: pprofConfig{
			Listen:  "127.0.0.1:7007",
			Enabled: false,
		},
		Dump: dumpConfig{
			Path: "/var/lib/graphite/dump/",
		},
		Prometheus: prometheusConfig{
			Enabled:  false,
			Endpoint: "/metrics",
			Labels:   make(map[string]string),
		},
		Logging: nil,
	}

	return cfg
}
func NewConfig() *Config {
	cfg := &Config{
		Common: commonConfig{
			GraphPrefix: "carbon.agents.{host}",
			MetricInterval: &Duration{
				Duration: time.Minute,
			},
			MetricEndpoint: MetricEndpointLocal,
			MaxCPU:         1,
			User:           "carbon",
		},
		Whisper: whisperConfig{
			DataDir:             "/var/lib/graphite/whisper/",
			SchemasFilename:     "/etc/go-carbon/storage-schemas.conf",
			AggregationFilename: "",
			MaxUpdatesPerSecond: 0,
			Enabled:             true,
			Workers:             1,
			Sparse:              false,
			FLock:               false,
			HashFilenames:       true,
		},
		Cache: cacheConfig{
			MaxSize:       1000000,
			WriteStrategy: "max",
		},
		Udp:    udp.NewOptions(),
		Tcp:    tcp.NewOptions(),
		Pickle: tcp.NewFramingOptions(),
		Carbonserver: carbonserverConfig{
			Listen:            "127.0.0.1:8080",
			Enabled:           false,
			Buckets:           10,
			MaxGlobs:          100,
			FailOnMaxGlobs:    false,
			MetricsAsCounters: false,
			ScanFrequency: &Duration{
				Duration: 300 * time.Second,
			},
			ReadTimeout: &Duration{
				Duration: 60 * time.Second,
			},
			IdleTimeout: &Duration{
				Duration: 60 * time.Second,
			},
			WriteTimeout: &Duration{
				Duration: 60 * time.Second,
			},
			QueryCacheEnabled: true,
			QueryCacheSizeMB:  0,
			FindCacheEnabled:  true,
			TrigramIndex:      true,
		},
		Carbonlink: carbonlinkConfig{
			Listen:  "127.0.0.1:7002",
			Enabled: true,
			ReadTimeout: &Duration{
				Duration: 30 * time.Second,
			},
		},
		Grpc: grpcConfig{
			Listen:  "127.0.0.1:7003",
			Enabled: true,
		},
		Tags: tagsConfig{
			Enabled: false,
			TagDB:   "http://127.0.0.1:8000",
			TagDBTimeout: &Duration{
				Duration: time.Second,
			},
			TagDBChunkSize:      32,
			TagDBUpdateInterval: 100,
			LocalDir:            "/var/lib/graphite/tagging/",
		},
		Pprof: pprofConfig{
			Listen:  "127.0.0.1:7007",
			Enabled: false,
		},
		Dump: dumpConfig{
			Path: "/var/lib/graphite/dump/",
		},
		Prometheus: prometheusConfig{
			Enabled:  false,
			Endpoint: "/metrics",
			Labels:   make(map[string]string),
		},
		Logging: nil,
	}

	return cfg
}
func NewConfig ( ) * Config { cfg := & Config { Common : commonConfig { GraphPrefix : " " , MetricInterval : & Duration { Duration : time . Minute , } , MetricEndpoint : MetricEndpointLocal , MaxCPU : 1 , User : " " , } , Whisper : whisperConfig { DataDir : " " , SchemasFilename : " " , AggregationFilename : " " , MaxUpdatesPerSecond : 0 , Enabled : true , Workers : 1 , Sparse : false , FLock : false , HashFilenames : true , } , Cache : cacheConfig { MaxSize : 1000000 , WriteStrategy : " " , } , Udp : udp . NewOptions ( ) , Tcp : tcp . NewOptions ( ) , Pickle : tcp . NewFramingOptions ( ) , Carbonserver : carbonserverConfig { Listen : " " , Enabled : false , Buckets : 10 , MaxGlobs : 100 , FailOnMaxGlobs : false , MetricsAsCounters : false , ScanFrequency : & Duration { Duration : 300 * time . Second , } , ReadTimeout : & Duration { Duration : 60 * time . Second , } , IdleTimeout : & Duration { Duration : 60 * time . Second , } , WriteTimeout : & Duration { Duration : 60 * time . Second , } , QueryCacheEnabled : true , QueryCacheSizeMB : 0 , FindCacheEnabled : true , TrigramIndex : true , } , Carbonlink : carbonlinkConfig { Listen : " " , Enabled : true , ReadTimeout : & Duration { Duration : 30 * time . Second , } , } , Grpc : grpcConfig { Listen : " " , Enabled : true , } , Tags : tagsConfig { Enabled : false , TagDB : " " , TagDBTimeout : & Duration { Duration : time . Second , } , TagDBChunkSize : 32 , TagDBUpdateInterval : 100 , LocalDir : " " , } , Pprof : pprofConfig { Listen : " " , Enabled : false , } , Dump : dumpConfig { Path : " " , } , Prometheus : prometheusConfig { Enabled : false , Endpoint : " " , Labels : make ( map [ string ] string ) , } , Logging : nil , } return cfg }
// NewConfig ...
NewConfig ...