Cloud Profiler 是一个低开销的统计性能剖析器,可从生产应用中持续收集有关 CPU 使用率和内存分配情况的信息。该性能剖析器会将获得的信息归因于应用的源代码,从而帮助您找出应用中资源耗用量最大的部分,还可以阐明代码的性能特征。
获享 $300 免费赠金开始概念验证
-
体验 Gemini 2.0 Flash Thinking
-
免费使用热门产品(包括 AI API 和 BigQuery)的每月用量
-
不会自动收费,无需承诺
继续探索 20 多种提供“始终免费”用量的产品
使用适用于常见应用场景(包括 AI API、虚拟机、数据仓库等)的 20 多种免费产品。
培训
培训和教程
在此 Codelab 中,您将了解如何为 Go 程序设置 Cloud Profiler,然后了解如何使用 Cloud Profiler 收集、查看和分析性能数据。
培训
培训和教程
优化 Go 应用
本教程将指导您下载并运行一个 Go 应用,然后使用性能剖析数据来优化该应用。
代码示例
代码示例
Go 示例
一组配置为收集性能剖析文件数据的 Go 应用。
代码示例
代码示例
Profiler 代码示例
一组代码示例,用于针对各种语言和环境配置 Profiler。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-08-18。
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-08-18。"],[],[],null,["# Cloud Profiler documentation\n============================\n\n[Read product documentation](/profiler/docs/about-profiler) **Cloud Profiler** is a statistical, low-overhead profiler that\ncontinuously gathers CPU usage and memory-allocation information from your\nproduction applications. It attributes that information to the application's\nsource code, helping you identify the parts of the application consuming the\nmost resources, and otherwise illuminating the performance characteristics\nof the code.\n[Get started for free](https://console.cloud.google.com/freetrial) \n\n#### Start your proof of concept with $300 in free credit\n\n- Get access to Gemini 2.0 Flash Thinking\n- Free monthly usage of popular products, including AI APIs and BigQuery\n- No automatic charges, no commitment \n[View free product offers](/free/docs/free-cloud-features#free-tier) \n\n#### Keep exploring with 20+ always-free products\n\n\nAccess 20+ free products for common use cases, including AI APIs, VMs, data warehouses,\nand more.\n\nDocumentation resources\n-----------------------\n\nFind quickstarts and guides, review key references, and get help with common issues. \nformat_list_numbered\n\n### Guides\n\n- Tutorial \n\n\n [Quickstart: Measure app performance](/profiler/docs/measure-app-performance)\n\n-\n\n\n Profiling applications:\n [Go](/profiler/docs/profiling-go),\n\n [Java](/profiler/docs/profiling-java),\n\n [Node.js](/profiler/docs/profiling-nodejs),\n or\n [Python](/profiler/docs/profiling-python)\n\n\n-\n\n [Profiling applications running outside of Google Cloud](/profiler/docs/profiling-external)\n\n-\n\n [Focus the flame graph](/profiler/docs/focusing-profiles)\n\n-\n\n [Compare profiles](/profiler/docs/comparing-profiles)\n\n-\n\n [View historical trends](/profiler/docs/history-view)\n\n-\n\n [Troubleshoot](/profiler/docs/troubleshooting)\n\nemoji_objects\n\n### Concepts\n\n-\n\n [Profiling concepts](/profiler/docs/concepts-profiling)\n\n-\n\n [Cloud Profiler overview](/profiler/docs/about-profiler)\n\n-\n\n [Flame graphs](/profiler/docs/concepts-flame)\n\ninfo\n\n### Resources\n\n-\n\n [Quotas and limits](/profiler/quotas)\n\n-\n\n [Release notes](/profiler/docs/release-notes)\n\nRelated resources\n-----------------\n\nTraining and tutorials \nCode samples \nExplore self-paced training, use cases, reference architectures, and code samples with examples of how to use and connect Google Cloud services. Training \nTraining and tutorials\n\n### Analyze production performance with Cloud Profiler\n\n\nIn this codelab, you learn how to set up Cloud Profiler for a Go program and then you\nlearn how to collect, view and analyze the performance data with Cloud Profiler.\n\n\n[Learn more](https://codelabs.developers.google.com/codelabs/cloud-profiler) \nTraining \nTraining and tutorials\n\n### Optimizing a Go app\n\n\nIn this tutorial, you download and run a Go application, and then you are guided\nthrough using profiling data to optimize that application.\n\n\n[Learn more](/profiler/docs/quickstart-go-app) \nCode sample \nCode Samples\n\n### Go samples\n\n\nA collection of Go applications configured to collect profile data.\n\n\n[Get started](/profiler/docs/go-samples) \nCode sample \nCode Samples\n\n### Profiler code samples\n\n\nA set of code samples for configuring Profiler for a variety of languages and environments.\n\n\n[Get started](/profiler/docs/samples)\n\nRelated videos\n--------------"]]