Created
May 31, 2017 14:14
-
-
Save mainroach/178b2f9b73ccb228ad63c1f88fa27033 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
from cloud_trace_gae import Trace | |
import webapp2 | |
class MainPage(webapp2.RequestHandler): | |
def get(self): | |
TContext = "NNNN/NNNN;xxxxx" | |
if 'X-Cloud-Trace-Context' in self.request.headers: | |
TContext=self.request.headers.get('X-Cloud-Trace-Context') | |
logging.info(TContext) | |
# Let's just trace some stuff | |
with TraceContext(TContext) as root: | |
time.sleep(0.1) | |
with root.span("slow") as spn: | |
time.sleep(2) | |
with root.span("my slow") as spn: | |
time.sleep(2) | |
with root.span("penut butter") as spn: | |
time.sleep(2) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I got the same GAE performance problem as you described in medium and youtube. I think the indentation is wrong.
Should it be?