Skip to content
This repository has been archived by the owner on Oct 17, 2018. It is now read-only.

Commit

Permalink
addressing comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Dmitriy Gromov committed Sep 25, 2017
1 parent 332e992 commit bbda415
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 20 deletions.
8 changes: 4 additions & 4 deletions rules/mapping.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ import (
)

var (
errMappingRuleSnapshotIdxOutOfRange = errors.New("mapping rule snapshot index out of range")
errNilMappingRuleSnapshotSchema = errors.New("nil mapping rule snapshot schema")
errNilMappingRuleSchema = errors.New("nil mapping rule schema")
errMappingRuleSnapshotIndexOutOfRange = errors.New("mapping rule snapshot index out of range")
errNilMappingRuleSnapshotSchema = errors.New("nil mapping rule snapshot schema")
errNilMappingRuleSchema = errors.New("nil mapping rule schema")
)

// mappingRuleSnapshot defines a rule snapshot such that if a metric matches the
Expand Down Expand Up @@ -147,7 +147,7 @@ type MappingRuleView struct {

func (mc *mappingRule) mappingRuleView(snapshotIdx int) (*MappingRuleView, error) {
if snapshotIdx < 0 || snapshotIdx >= len(mc.snapshots) {
return nil, errMappingRuleSnapshotIdxOutOfRange
return nil, errMappingRuleSnapshotIndexOutOfRange
}

mrs := mc.snapshots[snapshotIdx].clone()
Expand Down
22 changes: 11 additions & 11 deletions rules/namespace.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,16 @@ var (
emptyNamespace Namespace
emptyNamespaces Namespaces

errNamespaceSnapshotIdxOutOfRange = errors.New("namespace snapshot idx out of range")
errNilNamespaceSnapshotSchema = errors.New("nil namespace snapshot schema")
errNilNamespaceSchema = errors.New("nil namespace schema")
errNilNamespacesSchema = errors.New("nil namespaces schema")
errNilNamespaceSnapshot = errors.New("nil namespace snapshot")
errMultipleNamespaceMatches = errors.New("more than one namespace match found")
errNamespaceNotFound = errors.New("namespace not found")
errNamespaceNotTombstoned = errors.New("not tombstoned")
errNamespaceTombstoned = errors.New("already tombstoned")
errNoNamespaceSnapshots = errors.New("no snapshots")
errNamespaceSnapshotIndexOutOfRange = errors.New("namespace snapshot idx out of range")
errNilNamespaceSnapshotSchema = errors.New("nil namespace snapshot schema")
errNilNamespaceSchema = errors.New("nil namespace schema")
errNilNamespacesSchema = errors.New("nil namespaces schema")
errNilNamespaceSnapshot = errors.New("nil namespace snapshot")
errMultipleNamespaceMatches = errors.New("more than one namespace match found")
errNamespaceNotFound = errors.New("namespace not found")
errNamespaceNotTombstoned = errors.New("not tombstoned")
errNamespaceTombstoned = errors.New("already tombstoned")
errNoNamespaceSnapshots = errors.New("no snapshots")

namespaceActionErrorFmt = "cannot %s namespace %s. %v"
)
Expand Down Expand Up @@ -110,7 +110,7 @@ type NamespaceView struct {

func (n Namespace) namespaceView(snapshotIdx int) (*NamespaceView, error) {
if snapshotIdx < 0 || snapshotIdx >= len(n.snapshots) {
return nil, errNamespaceSnapshotIdxOutOfRange
return nil, errNamespaceSnapshotIndexOutOfRange
}
s := n.snapshots[snapshotIdx]
return &NamespaceView{
Expand Down
10 changes: 5 additions & 5 deletions rules/rollup.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ import (
var (
emptyRollupTarget RollupTarget

errRollupRuleSnapshotIdxOutOfRange = errors.New("rollup rule snapshot index out of range")
errNilRollupTargetSchema = errors.New("nil rollup target schema")
errNilRollupRuleSnapshotSchema = errors.New("nil rollup rule snapshot schema")
errNilRollupRuleSchema = errors.New("nil rollup rule schema")
errRollupRuleSnapshotIndexOutOfRange = errors.New("rollup rule snapshot index out of range")
errNilRollupTargetSchema = errors.New("nil rollup target schema")
errNilRollupRuleSnapshotSchema = errors.New("nil rollup rule snapshot schema")
errNilRollupRuleSchema = errors.New("nil rollup rule schema")
)

// RollupTarget dictates how to roll up metrics. Metrics associated with a rollup
Expand Down Expand Up @@ -269,7 +269,7 @@ type RollupRuleView struct {

func (rc *rollupRule) rollupRuleView(snapshotIdx int) (*RollupRuleView, error) {
if snapshotIdx < 0 || snapshotIdx >= len(rc.snapshots) {
return nil, errRollupRuleSnapshotIdxOutOfRange
return nil, errRollupRuleSnapshotIndexOutOfRange
}

rrs := rc.snapshots[snapshotIdx].clone()
Expand Down

0 comments on commit bbda415

Please sign in to comment.