This repository was archived by the owner on Mar 9, 2019. It is now read-only.
File tree 3 files changed +2
-31
lines changed
3 files changed +2
-31
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " statsum" ,
3
- "version" : " 0.4.0 " ,
3
+ "version" : " 0.4.1 " ,
4
4
"author" :
" Jonas Finnemann Jensen <[email protected] >" ,
5
5
"description" : " Client library for statsum" ,
6
6
"license" : " MPL-2.0" ,
23
23
"lodash" : " ^4.5.1" ,
24
24
"url-join" : " ^0.0.1"
25
25
},
26
- "optionalDependencies" : {
27
- "msgpack" : " ^1.0.2"
28
- },
29
26
"devDependencies" : {
30
27
"babel-compile" : " ^1.0.0" ,
31
28
"babel-core" : " ^6.1.21" ,
Original file line number Diff line number Diff line change @@ -2,26 +2,10 @@ let assert = require('assert');
2
2
let urljoin = require ( 'url-join' ) ;
3
3
let got = require ( 'got' ) ;
4
4
let debug = require ( 'debug' ) ( 'statsum' ) ;
5
- let msgpack = null ;
6
- try {
7
- msgpack = require ( 'msgpack' ) ;
8
- } catch ( err ) {
9
- debug ( 'Failed to load msgpack (optional dependency) falling back to json' ) ;
10
- }
11
5
12
- // Decide whether to use JSON or msgpack.
13
- // Note: msgpack is less bandwidth, but most importantly it is faster on the
14
- // server. JSON is a tiny bit faster on node, but since we have many
15
- // clients sending to one server we should optimize for fast server
16
- // processing (the server is most likely to a bottleneck).
17
6
let contentType = 'application/json' ;
18
7
let serialize = ( data ) => JSON . stringify ( data ) ;
19
8
let deserialize = ( data ) => JSON . parse ( data . toString ( 'utf8' ) ) ;
20
- if ( msgpack ) {
21
- contentType = 'application/msgpack' ;
22
- serialize = ( data ) => msgpack . pack ( data ) ;
23
- deserialize = ( data ) => msgpack . unpack ( data ) ;
24
- }
25
9
26
10
/** Send data-point to statsum */
27
11
let sendDataPoints = async ( configurer , options , payload ) => {
Original file line number Diff line number Diff line change @@ -6,18 +6,8 @@ suite('statsum', () => {
6
6
let getStream = require ( 'get-stream' ) ;
7
7
let _ = require ( 'lodash' ) ;
8
8
let debug = require ( 'debug' ) ( 'statsum' ) ;
9
- let msgpack = null ;
10
- try {
11
- msgpack = require ( 'msgpack' ) ;
12
- } catch ( err ) {
13
- debug ( 'Failed to load msgpack (optional dependency) falling back to json' ) ;
14
- }
15
- let deserialize = ( data ) => JSON . parse ( data . toString ( 'utf8' ) ) ;
16
- if ( msgpack ) {
17
- deserialize = ( data ) => msgpack . unpack ( data ) ;
18
- }
19
-
20
9
10
+ let deserialize = ( data ) => JSON . parse ( data . toString ( 'utf8' ) ) ;
21
11
let server = null ;
22
12
let baseUrl = null ;
23
13
let payload = null ;
You can’t perform that action at this time.
0 commit comments