Style changes and cleanup

This patch makes stylistic changes to error strings, unexports method names by lower casing them, removes unused dataSetMetric, and adds copyright/licence information.

Signed-Off-By: Corey Stewart <stewa169@purdue.edu>
This commit is contained in:
Corey Stewart 2016-12-06 14:22:26 -05:00 committed by Joe Handzik
commit a8c94d48e6
7 changed files with 76 additions and 50 deletions

View file

@ -1,3 +1,16 @@
// Copyright 2016 The Prometheus Authors
// 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 collector
import (
@ -11,13 +24,12 @@ import (
// zpool metrics
func (c *zfsCollector) parseZpoolOutput(reader io.Reader, handler func(string, string, float64)) (err error) {
scanner := bufio.NewScanner(reader)
for scanner.Scan() {
fields := strings.Fields(scanner.Text())
if len(fields) != 4 {
return fmt.Errorf("Unexpected output of zpool command")
return fmt.Errorf("unexpected output of zpool command")
}
valueString := fields[2]
@ -37,5 +49,4 @@ func (c *zfsCollector) parseZpoolOutput(reader io.Reader, handler func(string, s
}
return scanner.Err()
}