Skip to content
This repository has been archived by the owner on Nov 8, 2022. It is now read-only.

Commit

Permalink
added Elasticsearch collector plugin into the committed plugin catalog
Browse files Browse the repository at this point in the history
  • Loading branch information
candysmurf committed Feb 18, 2016
1 parent 15de406 commit d6a0ffa
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 32 deletions.
66 changes: 34 additions & 32 deletions control/control_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -245,38 +245,40 @@ func newListenToPluginEvent() *listenToPluginEvent {
}

func (l *listenToPluginEvent) HandleGomitEvent(e gomit.Event) {
switch v := e.Body.(type) {
case *control_event.RestartedAvailablePluginEvent:
l.plugin.EventNamespace = v.Namespace()
l.done <- struct{}{}
case *control_event.MaxPluginRestartsExceededEvent:
l.plugin.EventNamespace = v.Namespace()
l.done <- struct{}{}
case *control_event.DeadAvailablePluginEvent:
l.plugin.EventNamespace = v.Namespace()
l.done <- struct{}{}
case *control_event.LoadPluginEvent:
l.plugin.LoadedPluginName = v.Name
l.plugin.LoadedPluginVersion = v.Version
l.plugin.PluginType = v.Type
l.done <- struct{}{}
case *control_event.UnloadPluginEvent:
l.plugin.UnloadedPluginName = v.Name
l.plugin.UnloadedPluginVersion = v.Version
l.plugin.PluginType = v.Type
l.done <- struct{}{}
case *control_event.SwapPluginsEvent:
l.plugin.LoadedPluginName = v.LoadedPluginName
l.plugin.LoadedPluginVersion = v.LoadedPluginVersion
l.plugin.UnloadedPluginName = v.UnloadedPluginName
l.plugin.UnloadedPluginVersion = v.UnloadedPluginVersion
l.plugin.PluginType = v.PluginType
l.done <- struct{}{}
case *control_event.PluginSubscriptionEvent:
l.done <- struct{}{}
default:
fmt.Println("Got an event you're not handling")
}
go func() {
switch v := e.Body.(type) {
case *control_event.RestartedAvailablePluginEvent:
l.plugin.EventNamespace = v.Namespace()
l.done <- struct{}{}
case *control_event.MaxPluginRestartsExceededEvent:
l.plugin.EventNamespace = v.Namespace()
l.done <- struct{}{}
case *control_event.DeadAvailablePluginEvent:
l.plugin.EventNamespace = v.Namespace()
l.done <- struct{}{}
case *control_event.LoadPluginEvent:
l.plugin.LoadedPluginName = v.Name
l.plugin.LoadedPluginVersion = v.Version
l.plugin.PluginType = v.Type
l.done <- struct{}{}
case *control_event.UnloadPluginEvent:
l.plugin.UnloadedPluginName = v.Name
l.plugin.UnloadedPluginVersion = v.Version
l.plugin.PluginType = v.Type
l.done <- struct{}{}
case *control_event.SwapPluginsEvent:
l.plugin.LoadedPluginName = v.LoadedPluginName
l.plugin.LoadedPluginVersion = v.LoadedPluginVersion
l.plugin.UnloadedPluginName = v.UnloadedPluginName
l.plugin.UnloadedPluginVersion = v.UnloadedPluginVersion
l.plugin.PluginType = v.PluginType
l.done <- struct{}{}
case *control_event.PluginSubscriptionEvent:
l.done <- struct{}{}
default:
fmt.Println("Got an event you're not handling")
}
}()
}

var (
Expand Down
1 change: 1 addition & 0 deletions docs/PLUGIN_CATALOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ These plugins are in planned/active development. This list is useful if you want
| DBI | Collector | Collects metrics from SQL DBs using go's "sql" package | [snap-plugin-collector-dbi](https://github.com/intelsdi-x/snap-plugin-collector-dbi) | [@IzabellaRaulin](https://github.com/IzabellaRaulin) |
| Apache | Collector | Collects metrics from the Apache Webserver for mod_status| [snap-plugin-collector-apache](https://github.com/intelsdi-x/snap-plugin-collector-apache) | [@tiffanyfj](https://github.com/tiffanyfj) |
|
| Elasticsearch | Collector | Collects metrics from Elasticsearch cluster | [snap-plugin-collector-elasticsearch](https://github.com/intelsdi-x/snap-plugin-collector-elasticsearch) | [@candysmurf](https://github.com/candysmurf) |
| HEKA | Publisher | Publishes snap metrics into heka via TCP | [snap-plugin-publisher-heka](https://github.com/intelsdi-x/snap-plugin-publisher-heka) | [@candysmurf](https://github.com/candysmurf) |
|Graphite | Publisher | Publishes snap metrics to graphite | [snap-plugin-publisher-graphite](https://github.com/intelsdi-x/snap-plugin-publisher-graphite) | [@ircody](https://github.com/ircody) |

Expand Down

0 comments on commit d6a0ffa

Please sign in to comment.