top

Example of using the graphiteNop feature in action:

package mylib

import (
    "github.com/marpaia/graphite-golang"
    "log"
)

func init() {

    // load your configuration file / mechanism
    config := newConfig()

    // try to connect a graphite server
    if config.GraphiteEnabled {
        Graphite, err = graphite.NewGraphite(config.Graphite.Host, config.Graphite.Port)
    } else {
        Graphite = graphite.NewGraphiteNop(config.Graphite.Host, config.Graphite.Port)
    }
    // if you couldn't connect to graphite, use a nop
    if err != nil {
        Graphite = graphite.NewGraphiteNop(config.Graphite.Host, config.Graphite.Port)
    }

    log.Printf("Loaded Graphite connection: %#v", Graphite)
    Graphite.SimpleSend("stats.graphite_loaded", 1)
}

func doWork() {
    // this will work just fine, regardless of if you're working with a graphite
    // nop or not
    Graphite.SimpleSend("stats.doing_work", 1)
}

Imported by 38 package(s) ΒΆ

  1. github.com/BuJo/goneo/web
  2. github.com/IRCody/snap-plugin-publisher-graphite/graphite
  3. github.com/JensRantil/http-pinger
  4. github.com/ProTip/cw-engine/cwengine
  5. github.com/ProTip/mysql-engine
  6. github.com/akashihi/graphite-haproxy
  7. github.com/akashihi/graphite-memcached
  8. github.com/akashihi/graphite-mongo
  9. github.com/akashihi/graphite-mysql
  10. github.com/akashihi/graphite-nginx
  11. github.com/akashihi/graphite-phpfpm
  12. github.com/akashihi/graphite-redis
  13. github.com/akashihi/graphite-squid
  14. github.com/cblomart/vsphere-graphite
  15. github.com/chrissnell/crabby
  16. github.com/diocles/cm160-graphite
  17. github.com/divan/locust2graphite
  18. github.com/eliothedeman/bangarang/escalation/grafana-graphite-annotation
  19. github.com/fluxio/metricd/plugins
  20. github.com/hizel/pingd
  21. github.com/intelsdi-x/snap-plugin-publisher-graphite/graphite
  22. github.com/johntdyer/autoscale-grapher
  23. github.com/latencia/mosquitto-stats
  24. github.com/latencia/mtr-collect
  25. github.com/loggi/pglog-carbonizer
  26. github.com/loggi/pglog-carbonizer/pglog_carbonizer
  27. github.com/miolini/rabbitmq-graphite-tool
  28. github.com/orofarne/hmetrics2-graphite
  29. github.com/patdowney/stopgap/metrics
  30. github.com/protip/cw-engine/cwengine
  31. github.com/protip/mysql-engine
  32. github.com/samitpal/goProbe/metric_export
  33. github.com/samitpal/goProbe/push_metric/provider
  34. github.com/skyrings/skyring-common/monitoring/graphitemanager
  35. github.com/ventu-io/probe/server/reporting/handler
  36. github.com/victorcete/redis-scouter
  37. github.com/vimeo/graphite-aggregation-backfiller
  38. github.com/voxmedia/varniphite