MetroCollect  2.3.4
MetricsSourceArray.cc
Go to the documentation of this file.
1 //
2 // MetricsSourceArray.cc
3 //
4 // Created on August 8th 2018
5 //
6 // Copyright 2018 CFM (www.cfm.fr)
7 //
8 // Licensed under the Apache License, Version 2.0 (the "License");
9 // you may not use this file except in compliance with the License.
10 // You may obtain a copy of the License at
11 //
12 // http://www.apache.org/licenses/LICENSE-2.0
13 //
14 // Unless required by applicable law or agreed to in writing, software
15 // distributed under the License is distributed on an "AS IS" BASIS,
16 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 // See the License for the specific language governing permissions and
18 // limitations under the License.
19 //
20 
21 #include "SourceInterests.h"
22 #include "MetricsSourceArray.h"
23 
24 
27  procStat(SourceProcStat::get()),
28  procMemInfo(SourceProcMeminfo::get()),
29  procNetDev(SourceProcNetDev::get()),
30  ethtool(SourceEthtool::get())
31  { }
32 
34  return std::make_shared<std::vector<Interests>>(MetricsSourceArray::count, value);
35  }
36 }
Sources of network metrics extracted from the file /proc/net/dev.
static constexpr size_t count
Number of sources.
std::shared_ptr< std::vector< MetricsSource::Interests > > SourceInterests
Type used to store and share interests of multiple sources.
Namespace for sources of metrics objects and operations.
Sources of network metrics extracted from Ethtool interface.
Definition: SourceEthtool.h:40
Sources of CPU metrics extracted from the file /proc/stat.
SourceInterests makeSourceInterests(bool value)
Construct a new shared pointer to a SourceInterests object.
Sources of memory metrics extracted from the file /proc/meminfo.
MetricsSourceArray()
Construct a new Metrics Source Array object.