Demo os App Engine Python 2.7 with Background thread joined after writing response. Deploy to App Engine with the command:
gcloud app deployBrowse to the app
| { | |
| "combiner": "OR", | |
| "conditions": [ | |
| { | |
| "conditionAbsent": { | |
| "aggregations": [ | |
| { | |
| "alignmentPeriod": "60s", | |
| "crossSeriesReducer": "REDUCE_PERCENTILE_50", | |
| "perSeriesAligner": "ALIGN_DELTA" |
| /** | |
| * Copyright 2017, Google, Inc. | |
| * Licensed under the Apache License, Version 2.0 (the "License"); | |
| * you may not use this file except in compliance with the License. | |
| * You may obtain a copy of the License at | |
| * | |
| * http://www.apache.org/licenses/LICENSE-2.0 | |
| * | |
| * Unless required by applicable law or agreed to in writing, software | |
| * distributed under the License is distributed on an "AS IS" BASIS, |
| import math | |
| """Estimates the value of pi | |
| Uses the secant of successivly smaller slices of a unit circle | |
| as an estimate of the circumference | |
| """ | |
| # Initial value is the hypotenuse of a quarter of a circle | |
| # 2pi ~ 4 * srt(2) | |
| # pi ~ 2 * sqrt(2) |
You can debug an unhealthy app using Google Cloud Logging and other GCP tools even if the app has become unresponsive. A test app is provided that simulates the problem in an experiment for the purpose of explaining the debugging process with App Engine Flex.
Prerequisites: