
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
github.com/GoogleCloudPlatform/golang-samples/profiler
This directory contains Profiler samples. These samples are configured to collect profiling data and transmit that data to your Google Cloud Platform project. You can use the Profiler UI to analyze the collected profiles. For the Go language, your analysis options include CPU time, heap, allocated heap, contention, and thread analysis. You can even compare sets of profiles.
For profiling concepts, the capabilities of the Profiler UI, and how to configure your application to collect and transmit profiling data, see the Profiler documentation.
See the following configuration guides for details on modifying your application to collect and transmit profiling data:
See Profiling applications runing outside of Google Cloud Platform for additional configuration steps that are required when you are running your service outside of Google Cloud Platform.
Detailed instructions on executing these samples from Cloud Shell is included in Profiling samples.
The sample profiler_quickstart
is configured to run the hello-profiler
service.
This is a very simple service that is used by the
Quickstart guide.
The sample hotapp
is uses an infinite loop with two call stacks.
The Profiler documentation
includes images generated from this sample.
If you wish to generate profile data consistent with that included in the Profiler documentation,
run the hotapp
service with the following command line options:
go run main.go -service=docdemo-service -local_work -skew=75 -version=1.75.0
Sample hotmid
is an application that simulates multiple calls to a library
function made via different call paths. Each of these calls is not
particularly expensive (and so does not stand out on the flame graph). But
in the aggregate these calls add up to a significant time which can be
identified via looking at the flat list of functions' self and total time.
To execute a sample and collect profiling data in your GCP project, do the following:
If you have a new GCP, you need to enable the Profiler API for your project. Choose one of the following methods.
From the Cloud console, go to APIs & Services and then click Enable APIS and Services. Search for Profiler. If the API isn't enabled, click Enable.
From Cloud Shell, run the following command:
gcloud services enable cloudprofiler.googleapis.com
If you aren't running on GCP, then you need to create a service account. For details on these steps, see Profiling applications runing outside of Google Cloud Platform.
From your clone of the GitHub repository, change to the source directory of the program you want to execute.
For example, the following command changes the working directory to that for the sample hotapp
:
cd ~/gopath/src/github.com/GoogleCloudPlatform/golang-samples/profiler/hotapp
If you aren't running on GCP, edit main.go
and specify your GCP project ID.
Start the program:
go run main.go
A few seconds after you start the program, the message profiler has started
is displayed.
New messages are displayed each time a profile is uploaded to your GCP project.
To stop the program, enter Ctrl-C
.
To view your profile data, do the following:
Each time you click Now, the Profiler UI is refreshed and includes profiles up to the current point in time.
FAQs
Unknown package
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
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.