Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[bench] Xephon-K loader is working #12
- simply add a serializer struct and it goes on /w/, didn't meet any issue with http client yet, but I think the idle connect may need to be modified if I increase the number of workers
- Loading branch information
Showing
6 changed files
with
45 additions
and
4 deletions.
There are no files selected for viewing
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package serialize | ||
|
||
import ( | ||
"bytes" | ||
"encoding/json" | ||
|
||
"github.com/xephonhq/xephon-k/pkg/common" | ||
) | ||
|
||
type XephonKSerialize struct { | ||
} | ||
|
||
// WriteInt implements Serializer | ||
func (xk *XephonKSerialize) WriteInt(series common.IntSeries) []byte { | ||
buf := bytes.NewBufferString("[") | ||
j, err := json.Marshal(series) | ||
if err != nil { | ||
log.Panicf("can't serialize to json: %s", err.Error()) | ||
} | ||
buf.Write(j) | ||
buf.WriteString("]") | ||
return buf.Bytes() | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package serialize | ||
|
||
import "testing" | ||
|
||
func TestXephonKSerialize_WriteInt(t *testing.T) { | ||
xks := XephonKSerialize{} | ||
log.Info(string(xks.WriteInt(createDummyIntPoints()))) | ||
} |