![Create React App Officially Deprecated Amid React 19 Compatibility Issues](https://cdn.sanity.io/images/cgdhsj6q/production/04fa08cf844d798abc0e1a6391c129363cc7e2ab-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
google-cloud-profiler
Advanced tools
Python profiling agent for Google Cloud Profiler.
See Google Cloud Profiler profiling Python code for detailed documentation.
Linux. Profiling Python applications is supported for Linux kernels whose
standard C library is implemented with glibc
or with musl
. For configuration
information specific to Linux Alpine kernels, see
Running on Linux Alpine.
Python >= 3.7 and <= 3.11
Install the profiler package using PyPI:
pip3 install google-cloud-profiler
Enable the profiler in your application:
import googlecloudprofiler
def main():
# Profiler initialization. It starts a daemon thread which continuously
# collects and uploads profiles. Best done as early as possible.
try:
googlecloudprofiler.start(
service='hello-profiler',
service_version='1.0.1',
# verbose is the logging level. 0-error, 1-warning, 2-info,
# 3-debug. It defaults to 0 (error) if not set.
verbose=3,
# project_id must be set if not running on GCP.
# project_id='my-project-id',
)
except (ValueError, NotImplementedError) as exc:
print(exc) # Handle errors here
The Python profiling agent has a native component. The base Alpine image for
Python does not have all dependencies required to build this native component
installed. To build the Python profiling agent on Alpine, one must install the
package build-base
.
To use the Python profiling agent on Alpine without installing additional dependencies on to the final Alpine image, one can use a two-stage build and compile the Python profiling agent in the first stage.
Here is an example of a Docker image that uses a multi-stage build to compile and install the Python profiling agent:
FROM python:3.7-alpine as builder
# Install build-base to allow for compilation of the profiling agent.
RUN apk add --update --no-cache build-base
# Compile the profiling agent, generating wheels for it.
RUN pip3 wheel --wheel-dir=/tmp/wheels google-cloud-profiler
FROM python:3.7-alpine
# Copy over the directory containing wheels for the profiling agent.
COPY --from=builder /tmp/wheels /tmp/wheels
# Install the profiling agent.
RUN pip3 install --no-index --find-links=/tmp/wheels google-cloud-profiler
# Install any other required modules or dependencies, and copy an app which
# enables the profiler as described in "Enable the profiler in your
# application".
COPY ./bench.py .
# Run the application when the docker image is run, using either CMD (as is done
# here) or ENTRYPOINT.
CMD python3 -u bench.py
If you see the following log entries after enabling the Profiler:
BlockingIOError: [Errno 11] Resource temporarily unavailable
Exception ignored when trying to write to the signal wakeup fd
see https://cloud.google.com/profiler/docs/troubleshooting#python-blocking for the cause and the workaround.
FAQs
Google Cloud Profiler Python Agent
We found that google-cloud-profiler demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.