public sealed class Rollout.Types.TrafficPercentStrategy : IMessage<Rollout.Types.TrafficPercentStrategy>, IEquatable<Rollout.Types.TrafficPercentStrategy>, IDeepCloneable<Rollout.Types.TrafficPercentStrategy>, IBufferMessage, IMessage
Reference documentation and code samples for the Service Management v1 API class Rollout.Types.TrafficPercentStrategy.
Strategy that specifies how clients of Google Service Controller want to
send traffic to use different config versions. This is generally
used by API proxy to split traffic based on your configured percentage for
each config version.
One example of how to gradually rollout a new service configuration using
this
strategy:
Day 1
public MapField<string, double> Percentages { get; }
Maps service configuration IDs to their corresponding traffic percentage.
Key is the service configuration ID, Value is the traffic percentage
which must be greater than 0.0 and the sum must equal to 100.0.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-07 UTC."],[[["\u003cp\u003eThe \u003ccode\u003eRollout.Types.TrafficPercentStrategy\u003c/code\u003e class allows you to define how traffic is distributed among different service configuration versions.\u003c/p\u003e\n"],["\u003cp\u003eThis strategy uses a map called \u003ccode\u003ePercentages\u003c/code\u003e, where service configuration IDs are mapped to a traffic percentage.\u003c/p\u003e\n"],["\u003cp\u003eThe traffic percentage values in \u003ccode\u003ePercentages\u003c/code\u003e must be greater than 0.0 and sum up to 100.0 across all configurations.\u003c/p\u003e\n"],["\u003cp\u003eThe latest version of the class documented is 2.4.0, and there are several previous versions, including 2.3.0, 2.2.0, 2.1.0, 2.0.0, 1.5.0, 1.4.0, 1.3.0, 1.2.0 and 1.1.0.\u003c/p\u003e\n"]]],[],null,["# Service Management v1 API - Class Rollout.Types.TrafficPercentStrategy (2.4.0)\n\nVersion latestkeyboard_arrow_down\n\n- [2.4.0 (latest)](/dotnet/docs/reference/Google.Cloud.ServiceManagement.V1/latest/Google.Cloud.ServiceManagement.V1.Rollout.Types.TrafficPercentStrategy)\n- [2.3.0](/dotnet/docs/reference/Google.Cloud.ServiceManagement.V1/2.3.0/Google.Cloud.ServiceManagement.V1.Rollout.Types.TrafficPercentStrategy)\n- [2.2.0](/dotnet/docs/reference/Google.Cloud.ServiceManagement.V1/2.2.0/Google.Cloud.ServiceManagement.V1.Rollout.Types.TrafficPercentStrategy)\n- [2.1.0](/dotnet/docs/reference/Google.Cloud.ServiceManagement.V1/2.1.0/Google.Cloud.ServiceManagement.V1.Rollout.Types.TrafficPercentStrategy)\n- [2.0.0](/dotnet/docs/reference/Google.Cloud.ServiceManagement.V1/2.0.0/Google.Cloud.ServiceManagement.V1.Rollout.Types.TrafficPercentStrategy)\n- [1.5.0](/dotnet/docs/reference/Google.Cloud.ServiceManagement.V1/1.5.0/Google.Cloud.ServiceManagement.V1.Rollout.Types.TrafficPercentStrategy)\n- [1.4.0](/dotnet/docs/reference/Google.Cloud.ServiceManagement.V1/1.4.0/Google.Cloud.ServiceManagement.V1.Rollout.Types.TrafficPercentStrategy)\n- [1.3.0](/dotnet/docs/reference/Google.Cloud.ServiceManagement.V1/1.3.0/Google.Cloud.ServiceManagement.V1.Rollout.Types.TrafficPercentStrategy)\n- [1.2.0](/dotnet/docs/reference/Google.Cloud.ServiceManagement.V1/1.2.0/Google.Cloud.ServiceManagement.V1.Rollout.Types.TrafficPercentStrategy)\n- [1.1.0](/dotnet/docs/reference/Google.Cloud.ServiceManagement.V1/1.1.0/Google.Cloud.ServiceManagement.V1.Rollout.Types.TrafficPercentStrategy) \n\n public sealed class Rollout.Types.TrafficPercentStrategy : IMessage\u003cRollout.Types.TrafficPercentStrategy\u003e, IEquatable\u003cRollout.Types.TrafficPercentStrategy\u003e, IDeepCloneable\u003cRollout.Types.TrafficPercentStrategy\u003e, IBufferMessage, IMessage\n\nReference documentation and code samples for the Service Management v1 API class Rollout.Types.TrafficPercentStrategy.\n\nStrategy that specifies how clients of Google Service Controller want to\nsend traffic to use different config versions. This is generally\nused by API proxy to split traffic based on your configured percentage for\neach config version.\n\nOne example of how to gradually rollout a new service configuration using\nthis\nstrategy:\nDay 1 \n\n Rollout {\n id: \"example.googleapis.com/rollout_20160206\"\n traffic_percent_strategy {\n percentages: {\n \"example.googleapis.com/20160201\": 70.00\n \"example.googleapis.com/20160206\": 30.00\n }\n }\n }\n\nDay 2 \n\n Rollout {\n id: \"example.googleapis.com/rollout_20160207\"\n traffic_percent_strategy: {\n percentages: {\n \"example.googleapis.com/20160206\": 100.00\n }\n }\n }\n\nInheritance\n-----------\n\n[object](https://learn.microsoft.com/dotnet/api/system.object) \\\u003e Rollout.Types.TrafficPercentStrategy \n\nImplements\n----------\n\n[IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage-1.html)[Rollout](/dotnet/docs/reference/Google.Cloud.ServiceManagement.V1/latest/Google.Cloud.ServiceManagement.V1.Rollout)[Types](/dotnet/docs/reference/Google.Cloud.ServiceManagement.V1/latest/Google.Cloud.ServiceManagement.V1.Rollout.Types)[TrafficPercentStrategy](/dotnet/docs/reference/Google.Cloud.ServiceManagement.V1/latest/Google.Cloud.ServiceManagement.V1.Rollout.Types.TrafficPercentStrategy), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[Rollout](/dotnet/docs/reference/Google.Cloud.ServiceManagement.V1/latest/Google.Cloud.ServiceManagement.V1.Rollout)[Types](/dotnet/docs/reference/Google.Cloud.ServiceManagement.V1/latest/Google.Cloud.ServiceManagement.V1.Rollout.Types)[TrafficPercentStrategy](/dotnet/docs/reference/Google.Cloud.ServiceManagement.V1/latest/Google.Cloud.ServiceManagement.V1.Rollout.Types.TrafficPercentStrategy), [IDeepCloneable](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IDeepCloneable-1.html)[Rollout](/dotnet/docs/reference/Google.Cloud.ServiceManagement.V1/latest/Google.Cloud.ServiceManagement.V1.Rollout)[Types](/dotnet/docs/reference/Google.Cloud.ServiceManagement.V1/latest/Google.Cloud.ServiceManagement.V1.Rollout.Types)[TrafficPercentStrategy](/dotnet/docs/reference/Google.Cloud.ServiceManagement.V1/latest/Google.Cloud.ServiceManagement.V1.Rollout.Types.TrafficPercentStrategy), [IBufferMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IBufferMessage.html), [IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage.html) \n\nInherited Members\n-----------------\n\n[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) \n[object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) \n[object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)\n\nNamespace\n---------\n\n[Google.Cloud.ServiceManagement.V1](/dotnet/docs/reference/Google.Cloud.ServiceManagement.V1/latest/Google.Cloud.ServiceManagement.V1)\n\nAssembly\n--------\n\nGoogle.Cloud.ServiceManagement.V1.dll\n\nConstructors\n------------\n\n### TrafficPercentStrategy()\n\n public TrafficPercentStrategy()\n\n### TrafficPercentStrategy(TrafficPercentStrategy)\n\n public TrafficPercentStrategy(Rollout.Types.TrafficPercentStrategy other)\n\nProperties\n----------\n\n### Percentages\n\n public MapField\u003cstring, double\u003e Percentages { get; }\n\nMaps service configuration IDs to their corresponding traffic percentage.\nKey is the service configuration ID, Value is the traffic percentage\nwhich must be greater than 0.0 and the sum must equal to 100.0."]]