jbenet / node-bsdash

go-ipfs bitswap dashboard
MIT License
8 stars 2 forks source link

something broke #2

Open jbenet opened 8 years ago

jbenet commented 8 years ago
jbenet @ lorien : ~/git/ipfs/specs * overviews % bsdash
*** IPFS Bitswap Dash ***
Active Requests 0:
Provide Workers 0:
Task Workers 0:
Rebroadcast Worker:
Provider Connector:

events: 0/1 prints: 1 (25ms delay)
/Users/jbenet/git/node-bsdash/state.js:23
  var parts = e.event.split(".")
                     ^
TypeError: Cannot read property 'split' of undefined
    at updateState (/Users/jbenet/git/node-bsdash/state.js:23:22)
    at Object.State.s.update (/Users/jbenet/git/node-bsdash/state.js:14:5)
    at DestroyableTransform._transform (/Users/jbenet/git/node-bsdash/index.js:26:13)
    at DestroyableTransform.Transform._read (/Users/jbenet/git/node-bsdash/node_modules/through2/node_modules/readable-stream/lib/_stream_transform.js:172:10)
    at DestroyableTransform.Transform._write (/Users/jbenet/git/node-bsdash/node_modules/through2/node_modules/readable-stream/lib/_stream_transform.js:160:12)
    at doWrite (/Users/jbenet/git/node-bsdash/node_modules/through2/node_modules/readable-stream/lib/_stream_writable.js:323:12)
    at writeOrBuffer (/Users/jbenet/git/node-bsdash/node_modules/through2/node_modules/readable-stream/lib/_stream_writable.js:309:5)
    at DestroyableTransform.Writable.write (/Users/jbenet/git/node-bsdash/node_modules/through2/node_modules/readable-stream/lib/_stream_writable.js:236:11)
    at write (/Users/jbenet/git/node-bsdash/node_modules/ndjson/node_modules/through2/node_modules/readable-stream/lib/_stream_readable.js:623:24)
    at flow (/Users/jbenet/git/node-bsdash/node_modules/ndjson/node_modules/through2/node_modules/readable-stream/lib/_stream_readable.js:632:7)

@diasdavid @whyrusleeping any ideas?

daviddias commented 8 years ago

Seems that logs are different now, .event is not guaranteed to always exist:

example 1 - Didn't break

{ 
  event: 'log API client connected',
  session: 'b2b765ac-48b1-459c-8e1f-9fcd83868a3f',
  system: 'core/server',
  time: '2015-11-07T18:28:26.632599724Z' 
}

example 2 - Error thrown

{ 
  id: 5649,
  level: 5,
  message: 'bitswap net handleNewStream from <peer.ID bqE6Uf>',
  module: 'bitswap_network',
  time: '2015-11-07T18:28:30.288928034Z' 
}

@whyrusleeping, have you standardiz'ed the logs?

jbenet commented 8 years ago

://////

jbenet commented 8 years ago

need tests even on the logs