This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env pypy | |
from cffi import FFI | |
ffi = FFI() | |
ffi.cdef(r'typedef union _cairo_path_data_t cairo_path_data_t; union _cairo_path_data_t {struct {int type;int length;} header;struct {double x, y;} point;};typedef struct cairo_path {int status; union _cairo_path_data_t *data; int num_data;} cairo_path_t;') | |
def encode_path_ok(): | |
length = 4 | |
data = ffi.new('cairo_path_data_t[]', length) | |
# path = ffi.new('cairo_path_t *', (0, data, length)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
([([([u'asPercent', ([([u'Server01.connections.{failed,succeeded}'], {'pathExpression': [(u'Server01.connections.{failed,succeeded}', 0)]})], {'expression': [(([u'Server01.connections.{failed,succeeded}'], {'pathExpression': [(u'Server01.connections.{failed,succeeded}', 0)]}), 0)]}), ([([u'Server01.connections.attempted'], {'pathExpression': [(u'Server01.connections.attempted', 0)]})], {'expression': [(([u'Server01.connections.attempted'], {'pathExpression': [(u'Server01.connections.attempted', 0)]}), 0)]})], {'args': [(([([u'Server01.connections.{failed,succeeded}'], {'pathExpression': [(u'Server01.connections.{failed,succeeded}', 0)]})], {'expression': [(([u'Server01.connections.{failed,succeeded}'], {'pathExpression': [(u'Server01.connections.{failed,succeeded}', 0)]}), 0)]}), 1), (([([u'Server01.connections.attempted'], {'pathExpression': [(u'Server01.connections.attempted', 0)]})], {'expression': [(([u'Server01.connections.attempted'], {'pathExpression': [(u'Server01.connections.attempted', 0)]}), 0)]}), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/api/http/api.go b/api/http/api.go | |
index 0c83192..8ed939a 100644 | |
--- a/api/http/api.go | |
+++ b/api/http/api.go | |
@@ -491,7 +491,8 @@ func serializeSingleSeries(series *protocol.Series, precision TimePrecision, pre | |
if pretty { | |
return json.MarshalIndent(SerializeSeries(arg, precision)[0], "", JSON_PRETTY_PRINT_INDENT) | |
} else { | |
- return json.Marshal(SerializeSeries(arg, precision)[0]) | |
+// return json.Marshal(SerializeSeries(arg, precision)[0]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/api/http/api.go b/api/http/api.go | |
index 0c83192..4baeff8 100644 | |
--- a/api/http/api.go | |
+++ b/api/http/api.go | |
@@ -491,7 +491,7 @@ func serializeSingleSeries(series *protocol.Series, precision TimePrecision, pre | |
if pretty { | |
return json.MarshalIndent(SerializeSeries(arg, precision)[0], "", JSON_PRETTY_PRINT_INDENT) | |
} else { | |
- return json.Marshal(SerializeSeries(arg, precision)[0]) | |
+ return SerializeSeriesJson(arg, precision, 1), nil |