Advertisement
Guest User

Untitled

a guest
Dec 8th, 2016
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.99 KB | None | 0 0
  1. 20
  2. TINGYUN 2015-08-21 19:34:42 +08:00
  3. @glasslion 同学提抄袭这词有些严肃啊,那就认真的回复下这个质疑(明明上面的回复也很认真)@Strikeactor @beordle @zjxubinbin @alsotang
  4. 首先,听云绝对不会抄袭的。
  5. 听云和 New Relic 都是基于第三方的开源模块 wrapt ,加自主研发。两家都大量借用了 wrapt, requests 模块相关功能。某一语言的探针的监测原理是一样的,基于开源组件,部分源码有重叠,是自然的事情。
  6.  
  7. 下面是三段听云和 New Relic 核心代码的对照。
  8.  
  9. tingyun-hooks_entrance.py
  10. //i.v2ex.co/d0c12Dn1.png
  11. //i.v2ex.co/TVII4A7b.png
  12.  
  13. newrelic-weib_transaction.py
  14. import sys
  15. import cgi
  16. import base64
  17. import time
  18. import string
  19. import re
  20. import json
  21. import logging
  22.  
  23. try:
  24. import urlparse
  25. except ImportError:
  26. import urllib.parse as urlparse
  27.  
  28. import newrelic.packages.six as six
  29.  
  30. import newrelic.api.application
  31. import newrelic.api.transaction
  32. import newrelic.api.object_wrapper
  33. import newrelic.api.function_trace
  34. _logger = logging.getLogger (__name__)
  35.  
  36. _rum_header_fragment = '<script type="text/javascript">' \
  37. 'var NREUMQ=NREUMQ||[];NREUMQ.push (["mark","firstbyte",' \
  38. 'new Date ().getTime ()]);</script>'
  39.  
  40. _rum_footer_short_fragment = '<script type="text/javascript">' \
  41. 'if (!NREUMQ.f ){NREUMQ.f=function (){NREUMQ.push (["load",' \
  42. 'new Date ().getTime ()]);if (NREUMQ.a )NREUMQ.a ();};' \
  43. 'NREUMQ.a=window.onload;window.onload=NREUMQ.f;};' \
  44. 'NREUMQ.push (["nrf2","%s","%s","%s","%s",%d,%d,' \
  45. 'new Date ().getTime ()]);</script>'
  46.  
  47. _rum2_footer_short_fragment = '<script type="text/javascript">' \
  48. 'if (!NREUMQ.f ){NREUMQ.f=function (){NREUMQ.push (["load",' \
  49. 'new Date ().getTime ()]);if (NREUMQ.a )NREUMQ.a ();};' \
  50. 'NREUMQ.a=window.onload;window.onload=NREUMQ.f;};' \
  51. 'NREUMQ.push (["nrfj","%s","%s","%s","%s",%d,%d,' \
  52. 'new Date ().getTime (),"%s","%s","%s","%s","%s"]);</script>'
  53.  
  54. _rum_footer_long_fragment = '<script type="text/javascript">' \
  55. 'if (!NREUMQ.f ){NREU
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement