Skip to content

Commit

Permalink
Remove github.com/2opremio/go-1/codec
Browse files Browse the repository at this point in the history
* Bump github.com/ugorji/go/codec, to get fixes which make
  github.com/2opremio/go-1/codec unnecessary

* Remove github.com/2opremio/go-1/codec

* Remove type embeddings to avoid the problem explained at
  ugorji/go#141 (comment)
  • Loading branch information
Alfonso Acosta committed Feb 18, 2016
1 parent 07d3420 commit 7fc7da2
Show file tree
Hide file tree
Showing 64 changed files with 66 additions and 56,648 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ DOCKER_VERSION=1.6.2
DOCKER_DISTRIB=.pkg/docker-$(DOCKER_VERSION).tgz
DOCKER_DISTRIB_URL=https://get.docker.com/builds/Linux/x86_64/docker-$(DOCKER_VERSION).tgz
RUNSVINIT=vendor/runsvinit/runsvinit
CODECGEN_DIR=vendor/github.com/2opremio/go-1/codec/codecgen
CODECGEN_DIR=vendor/github.com/ugorji/go/codec/codecgen
CODECGEN_EXE=$(CODECGEN_DIR)/codecgen
GET_CODECGEN_DEPS=$(shell find $(1) -maxdepth 1 -type f -name '*.go' -not -name '*_test.go' -not -name '*.codecgen.go' -not -name '*.generated.go')
CODECGEN_TARGETS=report/report.codecgen.go render/render.codecgen.go render/detailed/detailed.codecgen.go
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ export default class NodeDetailsControlButton extends React.Component {
}

render() {
let className = `node-control-button fa ${this.props.control.icon}`;
let className = `node-control-button fa ${this.props.control.control.icon}`;
if (this.props.pending) {
className += ' node-control-button-pending';
}
return (
<span className={className} title={this.props.control.human} onClick={this.handleClick} />
<span className={className} title={this.props.control.control.human} onClick={this.handleClick} />
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export default class NodeDetailsControls extends React.Component {
{this.props.controls && this.props.controls.map(control => {
return (
<NodeDetailsControlButton nodeId={this.props.nodeId} control={control}
pending={this.props.pending} key={control.id} />
pending={this.props.pending} key={control.control.id} />
);
})}
</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ class NodeDetailsHealthItem extends React.Component {
<div className="node-details-health-item">
<div className="node-details-health-item-value">{formatMetric(this.props.value, this.props)}</div>
<div className="node-details-health-item-sparkline">
<Sparkline data={this.props.samples} max={this.props.max}
first={this.props.first} last={this.props.last} />
<Sparkline data={this.props.wire_metrics.samples} max={this.props.wire_metrics.max}
first={this.props.wire_metrics.first} last={this.props.wire_metrics.last} />
</div>
<div className="node-details-health-item-label">{this.props.label}</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions client/app/scripts/hoc/metric-feeder.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const WINDOW_LENGTH = 60;
* `[t1, t2, t3, ...]` will be fed to the wrapped component.
* The window slides between the dates provided by the first date of the buffer
* and `this.props.last` so that the following invariant is true:
* `this.state.movingFirst <= this.props.first < this.state.movingLast <= this.props.last`.
* `this.state.movingFirst <= this.props.wire_metrics.first < this.state.movingLast <= this.props.wire_metrics.last`.
*
* Samples have to be of type `[{date: String, value: Number}, ...]`.
* This component also keeps a historic max of all samples it sees over time.
Expand Down Expand Up @@ -60,7 +60,7 @@ export default ComposedComponent => class extends React.Component {
updateBuffer(props) {
// merge new samples into buffer
let buffer = this.state.buffer;
const nextSamples = makeOrderedMap(props.samples.map(d => [d.date, d.value]));
const nextSamples = makeOrderedMap(props.wire_metrics.samples.map(d => [d.date, d.value]));
// need to sort again after merge, some new data may have different times for old values
buffer = buffer.merge(nextSamples).sortBy(sortDate);
const state = {};
Expand Down
2 changes: 1 addition & 1 deletion client/app/scripts/utils/web-api-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ export function getApiDetails() {
export function doControlRequest(nodeId, control) {
clearTimeout(controlErrorTimer);
const url = `api/control/${encodeURIComponent(control.probeId)}/`
+ `${encodeURIComponent(control.nodeId)}/${control.id}`;
+ `${encodeURIComponent(control.nodeId)}/${control.control.id}`;
reqwest({
method: 'POST',
url: url,
Expand Down
2 changes: 1 addition & 1 deletion render/detailed/metadata.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ func (c Counter) MetadataRows(n report.Node) []MetadataRow {
}

// MetadataRow is a row for the metadata table.
// codecgen: skip

type MetadataRow struct {
ID string
Value string
Expand Down
14 changes: 7 additions & 7 deletions render/detailed/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ var (

// MetricRow is a tuple of data used to render a metric as a sparkline and
// accoutrements.
// codecgen: skip

type MetricRow struct {
ID string
Format string
Expand Down Expand Up @@ -73,12 +73,12 @@ func (*MetricRow) UnmarshalJSON(b []byte) error {
}

type wiredMetricRow struct {
ID string `json:"id"`
Label string `json:"label"`
Format string `json:"format,omitempty"`
Group string `json:"group,omitempty"`
Value float64 `json:"value"`
report.WireMetrics
ID string `json:"id"`
Label string `json:"label"`
Format string `json:"format,omitempty"`
Group string `json:"group,omitempty"`
Value float64 `json:"value"`
WireMetrics report.WireMetrics `json:"wire_metrics"`
}

// CodecEncodeSelf marshals this MetricRow. It takes the basic Metric
Expand Down
6 changes: 3 additions & 3 deletions render/detailed/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ type Node struct {
// ControlInstance contains a control description, and all the info
// needed to execute it.
type ControlInstance struct {
ProbeID string `json:"probeId"`
NodeID string `json:"nodeId"`
report.Control
ProbeID string `json:"probeId"`
NodeID string `json:"nodeId"`
Control report.Control `json:"control"`
}

// MakeNode transforms a renderable node to a detailed node. It uses
Expand Down
3 changes: 0 additions & 3 deletions render/detailed/summary.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ import (
)

// NodeSummaryGroup is a topology-typed group of children for a Node.
// Skip codec-generation for this type to circumvent render/detailed/summary.go
// codecgen: skip
type NodeSummaryGroup struct {
Label string `json:"label"`
Nodes []NodeSummary `json:"nodes"`
Expand All @@ -38,7 +36,6 @@ func (g NodeSummaryGroup) Copy() NodeSummaryGroup {

// Column provides special json serialization for column ids, so they include
// their label for the frontend.
// codecgen: skip
type Column string

// CodecEncodeSelf implements codec.Selfer
Expand Down
1 change: 0 additions & 1 deletion report/controls.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ func (cs Controls) AddControl(c Control) {
// NodeControls represent the individual controls that are valid for a given
// node at a given point in time. Its is immutable. A zero-value for Timestamp
// indicated this NodeControls is 'not set'.
// codecgen: skip
type NodeControls struct {
Timestamp time.Time
Controls StringSet
Expand Down
1 change: 0 additions & 1 deletion report/counters.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import (
)

// Counters is a string->int map.
// codecgen: skip
type Counters struct {
psMap ps.Map
}
Expand Down
1 change: 0 additions & 1 deletion report/edge_metadatas.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import (

// EdgeMetadatas collect metadata about each edge in a topology. Keys are the
// remote node IDs, as in Adjacency.
// codecgen: skip
type EdgeMetadatas struct {
psMap ps.Map
}
Expand Down
2 changes: 1 addition & 1 deletion report/latest_map.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (

// LatestMap is a persitent map which support latest-win merges. We have to
// embed ps.Map as its an interface. LatestMaps are immutable.
// codecgen: skip

type LatestMap struct {
ps.Map
}
Expand Down
1 change: 0 additions & 1 deletion report/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ func (m Metrics) Copy() Metrics {

// Metric is a list of timeseries data with some metadata. Clients must use the
// Add method to add values. Metrics are immutable.
// codecgen: skip
type Metric struct {
Samples ps.List
Min, Max float64
Expand Down
1 change: 0 additions & 1 deletion report/node_set.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import (

// NodeSet is a set of nodes keyed on (Topology, ID). Clients must use
// the Add method to add nodes
// codecgen: skip
type NodeSet struct {
psMap ps.Map
}
Expand Down
1 change: 0 additions & 1 deletion report/sets.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import (

// Sets is a string->set-of-strings map.
// It is immutable.
// codecgen: skip
type Sets struct {
psMap ps.Map
}
Expand Down
22 changes: 0 additions & 22 deletions vendor/github.com/2opremio/go-1/LICENSE

This file was deleted.

20 changes: 0 additions & 20 deletions vendor/github.com/2opremio/go-1/README.md

This file was deleted.

Loading

0 comments on commit 7fc7da2

Please sign in to comment.