Method: projects.getMetrics
সেভ করা পৃষ্ঠা গুছিয়ে রাখতে 'সংগ্রহ' ব্যবহার করুন
আপনার পছন্দ অনুযায়ী কন্টেন্ট সেভ করুন ও সঠিক বিভাগে রাখুন।
স্ক্রিপ্টের জন্য মেট্রিক্স ডেটা পান, যেমন মৃত্যুদন্ডের সংখ্যা এবং সক্রিয় ব্যবহারকারী।
HTTP অনুরোধ
GET https://script.googleapis.com/v1/projects/{scriptId}/metrics
URL gRPC ট্রান্সকোডিং সিনট্যাক্স ব্যবহার করে।
পাথ প্যারামিটার
পরামিতি |
---|
scriptId | string মেট্রিক্স পেতে স্ক্রিপ্ট নির্দেশ করে প্রয়োজনীয় ক্ষেত্র। |
ক্যোয়ারী প্যারামিটার
পরামিতি |
---|
metricsGranularity | enum ( MetricsGranularity ) মেট্রিক্সের কোন গ্রানুলারিটি ফেরত দেওয়া হয়েছে তা নির্দেশ করে প্রয়োজনীয় ক্ষেত্র। |
metricsFilter | object ( MetricsFilter ) অনুরোধে আবেদন করার জন্য ফিল্টার ধারণকারী ঐচ্ছিক ক্ষেত্র। এটি ফিল্টারে নির্দিষ্ট করা মেট্রিক্সের সুযোগকে সীমিত করে। |
শরীরের অনুরোধ
অনুরোধের বডি খালি হতে হবে।
প্রতিক্রিয়া শরীর
সফল হলে, প্রতিক্রিয়া বডিতে নিম্নলিখিত কাঠামোর সাথে ডেটা থাকে:
অনুরোধে উপস্থিত ফিল্টার এবং মাস্কের উপর ভিত্তি করে প্রদত্ত স্ক্রিপ্টের ব্যবহারের পরিসংখ্যান ধারণকারী সম্পদ।
ক্ষেত্র |
---|
activeUsers[] | object ( MetricsValue ) সক্রিয় ব্যবহারকারীর সংখ্যা। |
totalExecutions[] | object ( MetricsValue ) মোট মৃত্যুদণ্ডের সংখ্যা। |
failedExecutions[] | object ( MetricsValue ) ব্যর্থ মৃত্যুদণ্ডের সংখ্যা। |
অনুমোদনের সুযোগ
নিম্নলিখিত OAuth সুযোগ প্রয়োজন:
-
https://www.googleapis.com/auth/script.metrics
আরও তথ্যের জন্য, OAuth 2.0 ওভারভিউ দেখুন।
মেট্রিক্স গ্রানুলারিটি
এর জন্য ডেটা ফেরত দেওয়ার জন্য মেট্রিকের গ্রানুলারিটি।
Enums |
---|
UNSPECIFIED_GRANULARITY | ডিফল্ট মেট্রিক গ্রানুলারিটি কোন মেট্রিক্স কোয়েরি করতে ব্যবহৃত হয়। |
WEEKLY | সাপ্তাহিক মেট্রিক্স প্রতিনিধিত্ব করে। |
DAILY | 7 দিনের মেয়াদে দৈনিক মেট্রিক্সের প্রতিনিধিত্ব করে। |
মেট্রিক্স ফিল্টার
অনুরোধের সুযোগ কমাতে ব্যবহার করা ফিল্টার।
JSON প্রতিনিধিত্ব |
---|
{
"deploymentId": string
} |
ক্ষেত্র |
---|
deploymentId | string ঐচ্ছিক ক্ষেত্র থেকে মেট্রিক্স পুনরুদ্ধার করার জন্য একটি নির্দিষ্ট স্থাপনার নির্দেশ করে। |
মেট্রিক্স ভ্যালু
মেট্রিক্সের মান যা গণনা কার্যকর করার সংখ্যা রাখে।
JSON প্রতিনিধিত্ব |
---|
{
"value": string,
"startTime": string,
"endTime": string
} |
ক্ষেত্র |
---|
value | string গণনাকৃত মৃত্যুদণ্ডের সংখ্যা নির্দেশ করে। |
startTime | string ( Timestamp format) ব্যবধানের শুরুর সময় নির্দেশ করে প্রয়োজনীয় ক্ষেত্র। RFC3339 UTC "জুলু" ফর্ম্যাটে একটি টাইমস্ট্যাম্প, ন্যানোসেকেন্ড রেজোলিউশন এবং নয়টি পর্যন্ত ভগ্নাংশের সংখ্যা। উদাহরণ: "2014-10-02T15:01:23Z" এবং "2014-10-02T15:01:23.045123456Z" । |
endTime | string ( Timestamp format) ব্যবধানের শেষ সময় নির্দেশ করে প্রয়োজনীয় ক্ষেত্র। RFC3339 UTC "জুলু" ফর্ম্যাটে একটি টাইমস্ট্যাম্প, ন্যানোসেকেন্ড রেজোলিউশন এবং নয়টি পর্যন্ত ভগ্নাংশের সংখ্যা। উদাহরণ: "2014-10-02T15:01:23Z" এবং "2014-10-02T15:01:23.045123456Z" । |
অন্য কিছু উল্লেখ না করা থাকলে, এই পৃষ্ঠার কন্টেন্ট Creative Commons Attribution 4.0 License-এর অধীনে এবং কোডের নমুনাগুলি Apache 2.0 License-এর অধীনে লাইসেন্স প্রাপ্ত। আরও জানতে, Google Developers সাইট নীতি দেখুন। Java হল Oracle এবং/অথবা তার অ্যাফিলিয়েট সংস্থার রেজিস্টার্ড ট্রেডমার্ক।
2025-07-24 UTC-তে শেষবার আপডেট করা হয়েছে।
[null,null,["2025-07-24 UTC-তে শেষবার আপডেট করা হয়েছে।"],[[["\u003cp\u003eRetrieve usage statistics for Apps Script projects, including active users, total executions, and failed executions.\u003c/p\u003e\n"],["\u003cp\u003eFilter metrics by granularity (daily, weekly) and specific deployments.\u003c/p\u003e\n"],["\u003cp\u003eRequires authorization with the \u003ccode\u003ehttps://www.googleapis.com/auth/script.metrics\u003c/code\u003e scope.\u003c/p\u003e\n"],["\u003cp\u003eThe API uses a \u003ccode\u003eGET\u003c/code\u003e request with path and query parameters to specify the script and desired metrics.\u003c/p\u003e\n"],["\u003cp\u003eResponse data includes metric values with start and end times for the specified intervals.\u003c/p\u003e\n"]]],[],null,["# Method: projects.getMetrics\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Path parameters](#body.PATH_PARAMETERS)\n- [Query parameters](#body.QUERY_PARAMETERS)\n- [Request body](#body.request_body)\n- [Response body](#body.response_body)\n - [JSON representation](#body.Metrics.SCHEMA_REPRESENTATION)\n- [Authorization Scopes](#body.aspect)\n- [MetricsGranularity](#MetricsGranularity)\n- [MetricsFilter](#MetricsFilter)\n - [JSON representation](#MetricsFilter.SCHEMA_REPRESENTATION)\n- [MetricsValue](#MetricsValue)\n - [JSON representation](#MetricsValue.SCHEMA_REPRESENTATION)\n- [Try it!](#try-it)\n\nGet metrics data for scripts, such as number of executions and active users.\n\n### HTTP request\n\n`GET https://script.googleapis.com/v1/projects/{scriptId}/metrics`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Path parameters\n\n| Parameters ||\n|------------|-------------------------------------------------------------------|\n| `scriptId` | `string` Required field indicating the script to get metrics for. |\n\n### Query parameters\n\n| Parameters ||\n|----------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `metricsGranularity` | `enum (`[MetricsGranularity](/apps-script/api/reference/rest/v1/projects/getMetrics#MetricsGranularity)`)` Required field indicating what granularity of metrics are returned. |\n| `metricsFilter` | `object (`[MetricsFilter](/apps-script/api/reference/rest/v1/projects/getMetrics#MetricsFilter)`)` Optional field containing filters to apply to the request. This limits the scope of the metrics returned to those specified in the filter. |\n\n### Request body\n\nThe request body must be empty.\n\n### Response body\n\nIf successful, the response body contains data with the following structure:\nResource containing usage stats for a given script, based on the supplied filter and mask present in the request.\n\n| JSON representation |\n|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ``` { \"activeUsers\": [ { object (/apps-script/api/reference/rest/v1/projects/getMetrics#MetricsValue) } ], \"totalExecutions\": [ { object (/apps-script/api/reference/rest/v1/projects/getMetrics#MetricsValue) } ], \"failedExecutions\": [ { object (/apps-script/api/reference/rest/v1/projects/getMetrics#MetricsValue) } ] } ``` |\n\n| Fields ||\n|----------------------|-------------------------------------------------------------------------------------------------------------------------------|\n| `activeUsers[]` | `object (`[MetricsValue](/apps-script/api/reference/rest/v1/projects/getMetrics#MetricsValue)`)` Number of active users. |\n| `totalExecutions[]` | `object (`[MetricsValue](/apps-script/api/reference/rest/v1/projects/getMetrics#MetricsValue)`)` Number of total executions. |\n| `failedExecutions[]` | `object (`[MetricsValue](/apps-script/api/reference/rest/v1/projects/getMetrics#MetricsValue)`)` Number of failed executions. |\n\n### Authorization Scopes\n\nRequires the following OAuth scope:\n\n- `https://www.googleapis.com/auth/script.metrics`\n\nFor more information, see the [OAuth 2.0 Overview](https://developers.google.com/identity/protocols/OAuth2).\n\nMetricsGranularity\n------------------\n\nThe granularity of metric to return data for.\n\n| Enums ||\n|---------------------------|------------------------------------------------------|\n| `UNSPECIFIED_GRANULARITY` | Default metric granularity used to query no metrics. |\n| `WEEKLY` | Represents weekly metrics. |\n| `DAILY` | Represents daily metrics over a period of 7 days. |\n\nMetricsFilter\n-------------\n\nFilter used to reduce the scope of the request.\n\n| JSON representation |\n|------------------------------------|\n| ``` { \"deploymentId\": string } ``` |\n\n| Fields ||\n|----------------|------------------------------------------------------------------------------------|\n| `deploymentId` | `string` Optional field indicating a specific deployment to retrieve metrics from. |\n\nMetricsValue\n------------\n\nMetrics value that holds number of executions counted.\n\n| JSON representation |\n|---------------------------------------------------------------------|\n| ``` { \"value\": string, \"startTime\": string, \"endTime\": string } ``` |\n\n| Fields ||\n|-------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `value` | `string` Indicates the number of executions counted. |\n| `startTime` | `string (`[Timestamp](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.Timestamp)` format)` Required field indicating the start time of the interval. A timestamp in RFC3339 UTC \"Zulu\" format, with nanosecond resolution and up to nine fractional digits. Examples: `\"2014-10-02T15:01:23Z\"` and `\"2014-10-02T15:01:23.045123456Z\"`. |\n| `endTime` | `string (`[Timestamp](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.Timestamp)` format)` Required field indicating the end time of the interval. A timestamp in RFC3339 UTC \"Zulu\" format, with nanosecond resolution and up to nine fractional digits. Examples: `\"2014-10-02T15:01:23Z\"` and `\"2014-10-02T15:01:23.045123456Z\"`. |"]]