同步报表
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
什么是同步报表?
同步报表是指生成速度必须非常快的小报表。
在收到要生成同步报表的请求之后,DCM 报表平台会立即开始为您生成相应报表。您最好在急需少量数据时使用此类报告 - 例如,当您在图形界面中显示指标时。
同步和
异步生成报表?
异步生成报表通常至少需要几分钟,即使您请求的是少量数据也如此。同步
报告可以更快地返回这些数据,但代价是
运行超时。您应该在出现以下情况时异步生成报告:无法在同步超时期限内生成报告;或者您未处于一个对时间比较敏感的环境(例如界面)。
什么是同步报表超时期限?
如果报表小到足以在 10 秒之内生成,则系统会根据您的初始生成请求返回一个完整的报表文件。
否则,DCM 的报表生成操作会在 50 秒后超时。
如果同步报表所花费的时间过长,会出现什么情况?
如果没有在超时期限内生成同步报表,系统会中断该过程并会将该报表转移到异步报表生成队列中。如果您的报告生成操作没有失败或返回错误,但进入了异步报表队列,则意味着您的报告至少需要几分钟时间才能生成。
如果您的报告超出了
同步报表超时期限(除报表生成时间以外)
。该报表可能会在 50 秒之内同步完成,或者
将变为异步并需要几分钟时间。
哪些报表类型支持同步生成?
除以下几种报表之外,其他所有报表类型均支持同步生成:
其他报表类型都支持同步生成。不过,如果您使用的数据过多或指标和维度组合的处理需要耗用大量资源的话,这些报表仍会出现超时。
如何生成同步报表?
默认情况下,所有报告都是异步生成的。请求生成新报告文件时,您可以将可选的 synchronous
参数设置为 true
,以请求同步生成报告。请参阅
示例代码。
我是否应该请求同步生成我的所有报表?
不可以,您只有在预期
在超时期限内完成报告。如果报表开始生成
并达到超时限制,那么报告将
报告的总执行次数
即异步生成报告所需的时间加上
同步超时期限。因此,如果您异步请求报表,则可以避免同步超时期限这一额外延迟。
我请求的指标和维度是否会影响
报告的生成时间?
是的,会有所影响。有些指标和维度相较于其他指标和维度需要更多时间进行编制,其中部分指标和维度还会导致同步报表总是出现超时。地理维度就属于此类维度。这类维度一般不会快到足以包含在同步报表中,即使有这种情况,也非常罕见。
如何缩短
以允许同步生成报表?
需要考虑的因素有很多,例如所含广告系列的规模和
报告覆盖的时间范围,会影响速度。要想让系统更快速地生成报表,最好的方法就是通过稍做手动调整使报表的块头变得足够小 - 先确定您希望能够快速显示的所有内容,然后尝试削减相应报表,直到它能够成功地同步完成为止。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-08-31。
[null,null,["最后更新时间 (UTC):2025-08-31。"],[[["\u003cp\u003eSynchronous reports are best for retrieving small amounts of data quickly, such as for graphical user interfaces, and have a timeout period.\u003c/p\u003e\n"],["\u003cp\u003eIf a synchronous report takes longer than the timeout period (10 seconds for small reports or 50 seconds otherwise), it automatically switches to asynchronous processing, which takes longer.\u003c/p\u003e\n"],["\u003cp\u003eAll report types support synchronous execution except for the Path to Conversion report and the Floodlight report (with \u003ccode\u003edfa:floodlightImpressions\u003c/code\u003e included).\u003c/p\u003e\n"],["\u003cp\u003eTo run a report synchronously, set the optional \u003ccode\u003esynchronous\u003c/code\u003e parameter to \u003ccode\u003etrue\u003c/code\u003e when requesting report generation.\u003c/p\u003e\n"],["\u003cp\u003eOnly use synchronous execution when you anticipate the report to finish within the timeout period; otherwise, requesting asynchronous execution initially is more efficient.\u003c/p\u003e\n"]]],[],null,["# Synchronous Reports\n\nWhat is a synchronous report?\n-----------------------------\n\nA synchronous report is a small report that must run very quickly.\nUpon receiving a request to run a synchronous report, the DCM reporting\nplatform will begin executing it for you immediately. Reports like these\nare best used in situations where you need a small chunk of data\nquickly, such as when you are displaying metrics in a graphical user\ninterface.\n\nWhat is the difference between synchronous and\nasynchronous report generation?\n------------------------------------------------------------------------------\n\nRunning a report asynchronously will always take at least a few\nminutes, even if you are requesting a small amount of data. Synchronous\nreports return this data much faster at the cost of putting a low\ntimeout on how long the report can take to run. You should use\nasynchronous report generation when the report cannot be run within the\nsynchronous timeout period or when you're not in a time-sensitive\nenvironment such as a user interface.\n\nWhat is the synchronous report timeout period?\n----------------------------------------------\n\nIf the report is small enough to run in 10 seconds or less, the\nsystem will return a complete report file to your initial run request.\nOtherwise, DCM reporting will execute your report for a period of 50\nseconds before timing out.\n\nWhat happens if a synchronous report takes too\nlong?\n----------------------------------------------------\n\nIf the generation of a synchronous report does not complete within the\ntimeout period, the generation is halted and the report fails over into\nour asynchronous reporting queue. Your report will **not**\nfail or return an error, but moving into the asynchronous reporting\nqueue means that your report will now take at least a few minutes to\ngenerate.\n\nYou will receive no indication that your report exceeded the\nsynchronous reporting timeout period other than the report's generation\ntime. It will either complete synchronously in 50 seconds or less or\nbecome asynchronous and require several minutes.\n\nWhich report types support synchronous execution?\n-------------------------------------------------\n\nAll report types support synchronous execution with the exception of:\n\n- The [Path to Conversion report](//support.google.com/dcm/answer/2823644), which never supports synchronous reporting.\n- The [Floodlight report](//support.google.com/dcm/answer/2823790), which only supports synchronous reporting if `dfa:floodlightImpressions` are excluded.\n\n\u003cbr /\u003e\n\nThe other report types all support synchronous execution but will still\ntimeout if too much data or a resource-intensive mix of metrics and\ndimensions are used.\n\nHow do I run a synchronous report?\n----------------------------------\n\nBy default, all reports run asynchronously. When requesting the\ngeneration of a new report file, you can set the optional\n`synchronous`\nparameter to\n`true`\nto request the report be run synchronously. Refer to the [example code](/doubleclick-advertisers/current/reports/run#examples) in our documentation.\n\nShould I request all my reports with synchronous\nexecution?\n-----------------------------------------------------------\n\nNo, you should only request synchronous execution when you expect\nthe report to finish within the timeout period. If your report starts\nwith synchronous execution and hits the timeout limit, the report will\nbe moved to the asynchronous queue---the report's total execution\ntime will be the time required to generate the report asynchronously plus\nthe synchronous timeout period. Thus, if you had requested the report\nasynchronously, you would have avoided the additional delay of\nthe synchronous timeout period.\n\nWill the metrics and dimensions I request affect the\ngeneration time of my reports?\n-----------------------------------------------------------------------------------\n\nYes, they will. Certain metrics and dimensions take longer to\ncompile than others and some of them may even cause your synchronous\nreports to always timeout. Geographical dimensions are one such\ndimension that will rarely, if ever, be fast enough to include in\nsynchronous reports.\n\nHow can I shorten the time needed to generate my\nreports to allow synchronous reporting?\n----------------------------------------------------------------------------------------\n\nMany factors, such as the size of the campaigns included and the\ntimespan that the report covers, affect speed. A bit of manual\ntweaking is often the best way to get your reports down to small enough\nchunks---start with everything you want to be able to display quickly,\nand then try whittling the report down until it successfully completes\nsynchronously."]]