com.spotify.statistics.StaticMuninGraphProvider Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of metrics-munin-reporter Show documentation
Show all versions of metrics-munin-reporter Show documentation
Munin reporter for Coda Hale's metrics lib
The newest version!
/*
* Copyright (c) 2012-2014 Spotify AB
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.spotify.statistics;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class StaticMuninGraphProvider implements MuninGraphProvider {
private final Map graphs;
public Map getGraphs() {
return graphs;
}
public StaticMuninGraphProvider(final List graphs) {
Map graphMap = new HashMap();
for (MuninGraph graph : graphs) {
graphMap.put(graph.getName(), graph);
}
this.graphs = Collections.unmodifiableMap(graphMap);
}
public StaticMuninGraphProvider(final Map graphs) {
this.graphs = Collections.unmodifiableMap(new HashMap(graphs));
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy