Skip to content

Commit 8a8b9fd

Browse files
committed
update terraform provider with latest database schema, removing unused parts of the route shader
1 parent 6e6e59d commit 8a8b9fd

File tree

2 files changed

+7
-73
lines changed

2 files changed

+7
-73
lines changed

docs/data-sources/route_shaders.md

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,22 +26,16 @@ Required:
2626

2727
- `ab_test` (Boolean) If true then AB test mode is enabled. 50%% of users will be eligible for acceleration, and 50%% will not be eligible for acceleration. In the accelerated group, players are only accelerated if the remaining route shader parameters determine they should be accelerated.
2828
- `acceptable_latency` (Number) The amount of latency that is acceptable in milliseconds. Any latency above this is eligible for acceleration. For example, setting this value to 50ms would exclude any players with latency < 50ms from being accelerated. Default is 20ms
29-
- `acceptable_packet_loss_instant` (Number) The instantaneous packet loss that is acceptable. For example, setting to 1%% will allow packet loss up to 1%% in a 10 second period before enabling acceleration. Default is 0.25%%
30-
- `acceptable_packet_loss_sustained` (Number) The sustained packet loss that is acceptable. For example, setting to 0.1%% will allow packet loss up to 0.1%% in a 30 second period before enabling acceleration. Default is 0.1%%
31-
- `analysis_only` (Boolean) Set this to true and acceleration is disabled. Analytics data will still be gathered from players of any buyer who use this route shader. Use this when you want to gather network perforance data for players, but you want accelerated turned off. Default is false.
29+
- `acceptable_packet_loss` (Number) The instantaneous packet loss that is acceptable. For example, setting to 1%% will allow packet loss up to 1%% in a 10 second period before enabling acceleration. Default is 0.25%%
3230
- `bandwidth_envelope_down_kbps` (Number) The maximum amount of acceleration bandwidth down in the server to client direction in kilobits per-second (kbps). Exceeding this amount of bandwidth for a session will result in packets above the limit not being accelerated. Default value is 1024 (1mbps).
3331
- `bandwidth_envelope_up_kbps` (Number) The maximum amount of acceleration bandwidth up in the client to server direction in kilobits per-second (kbps). Exceeding this amount of bandwidth for a session will result in packets above the limit not being accelerated. Default value is 1024 (1mbps).
3432
- `disable_network_next` (Boolean) Set this to true and network next is completely disabled for players belonging to any buyer using this route shader. No acceleration will be applied and no data will be collected.
3533
- `force_next` (Boolean) Force all players to be accelerated. This is useful for testing, or if you have a small professional player base for whom you want to enable acceleration BEFORE anything goes wrong, instead of being reactive and only accelerating them after something goes wrong. Default is false.
3634
- `latency_reduction_threshold` (Number) The minimum latency reduction threshold in milliseconds. A latency reduction greater than or equal to this number in milliseconds must be predicted in order to accelerate the player. For example, 10ms would only accelerate players if a latency reduction >= 10ms is predicted. Default is 10ms.
3735
- `max_latency_trade_off` (Number) The maximum amount of latency to trade for reduced packet loss. Packet loss above a certain amount is generally considered worse than latency. Trade up to this amount of latency to take a route with reduced packet loss. IMPORTANT: Network Next will still prefer the lowest latency route available. Default value is 20ms.
38-
- `max_next_rtt` (Number) The maximum network next latency allowed. There is no point patting yourself on the back when you reduce 500ms latency to 450ms. 450ms is still completely unplayable! Set this value to the maximum reasonable accelerated latency that makes sense for your game. Network Next will not accelerate a player if their predicted post-acceleration latency is higher than this value. Default value is 250ms.
39-
- `multipath` (Boolean) If this is set to true then packets will be sent across the direct route (default internet path), as well as the network next path when a player is accelerated. Recommend setting this to true always. Default value is true.
4036
- `name` (String) The name of the route shader. Generally, it's best to set it to the same name as the buyer that will use it. Typically, there is one route shader per-buyer.
41-
- `route_diversity` (Number) The minimum amount of distinct viable routes that must be available for a player to be accelerated. This setting can be useful to limit players in remote regions from taking network next when there is only one relay available to them. Only players with mulitple distinct paths will be accelerated, so there are backups if one relay becomse unroutable for this player. Don't set this too high or players with bad edge network conditions won't get accelerated. Default value is 0.
4237
- `route_select_threshold` (Number) When initially selecting a route, find routes within this amount of milliseconds of the best available route and consider them to be equal, randomly selecting between them. Don't set this too low, or you won't get effective load balancing across relays. Default value is 5ms.
4338
- `route_switch_threshold` (Number) If a player is already being accelerated, and a better route is available with a reduction of at least this much milliseconds from the current route, then switch to it. Don't set this too low or sessions will switch routes every 10 seconds due to natural fluctuation. Default value is 10ms.
44-
- `rtt_veto` (Number) If the accelerated latency becomes worse than the direct latency (default internet route) by this amount of milliseconds, then veto the session and stop accelerating the player. This is to avoid players hopping on/off of network next when latency fluctuation occurs. Don't set this too low, or players with fluctuating latency (due to edge issues or wifi) will fall off network next due to temporary high latency conditions. Default value is 20ms.
4539
- `selection_percent` (Number) The percentage of players eligible for acceleration. For example, setting this to 10%% would only accelerate 1 in 10 players. Default value is 100%% (all players eligible for acceleration).
4640

4741
Read-Only:

networknext/data.go

Lines changed: 6 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -751,45 +751,33 @@ type RouteShaderData struct {
751751
RouteShaderName string `json:"route_shader_name"`
752752
ABTest bool `json:"ab_test"`
753753
AcceptableLatency int `json:"acceptable_latency"`
754-
AcceptablePacketLossInstant float64 `json:"acceptable_packet_loss_instant"`
755-
AcceptablePacketLossSustained float64 `json:"acceptable_packet_loss_sustained"`
756-
AnalysisOnly bool `json:"analysis_only"`
754+
AcceptablePacketLoss float64 `json:"acceptable_packet_loss"`
757755
BandwidthEnvelopeUpKbps int `json:"bandwidth_envelope_up_kbps"`
758756
BandwidthEnvelopeDownKbps int `json:"bandwidth_envelope_down_kbps"`
759757
DisableNetworkNext bool `json:"disable_network_next"`
760758
LatencyReductionThreshold int `json:"latency_reduction_threshold"`
761-
Multipath bool `json:"multipath"`
762759
SelectionPercent float64 `json:"selection_percent"`
763760
MaxLatencyTradeOff int `json:"max_latency_trade_off"`
764-
MaxNextRTT int `json:"max_next_rtt"`
765761
RouteSwitchThreshold int `json:"route_switch_threshold"`
766762
RouteSelectThreshold int `json:"route_select_threshold"`
767-
RTTVeto int `json:"rtt_veto"`
768763
ForceNext bool `json:"force_next"`
769-
RouteDiversity int `json:"route_diversity"`
770764
}
771765

772766
type RouteShaderModel struct {
773767
Id types.Int64 `tfsdk:"id"`
774768
Name types.String `tfsdk:"name"`
775769
ABTest types.Bool `tfsdk:"ab_test"`
776770
AcceptableLatency types.Int64 `tfsdk:"acceptable_latency"`
777-
AcceptablePacketLossInstant types.Float64 `tfsdk:"acceptable_packet_loss_instant"`
778-
AcceptablePacketLossSustained types.Float64 `tfsdk:"acceptable_packet_loss_sustained"`
779-
AnalysisOnly types.Bool `tfsdk:"analysis_only"`
771+
AcceptablePacketLoss types.Float64 `tfsdk:"acceptable_packet_loss"`
780772
BandwidthEnvelopeUpKbps types.Int64 `tfsdk:"bandwidth_envelope_up_kbps"`
781773
BandwidthEnvelopeDownKbps types.Int64 `tfsdk:"bandwidth_envelope_down_kbps"`
782774
DisableNetworkNext types.Bool `tfsdk:"disable_network_next"`
783775
LatencyReductionThreshold types.Int64 `tfsdk:"latency_reduction_threshold"`
784-
Multipath types.Bool `tfsdk:"multipath"`
785776
SelectionPercent types.Float64 `tfsdk:"selection_percent"`
786777
MaxLatencyTradeOff types.Int64 `tfsdk:"max_latency_trade_off"`
787-
MaxNextRTT types.Int64 `tfsdk:"max_next_rtt"`
788778
RouteSwitchThreshold types.Int64 `tfsdk:"route_switch_threshold"`
789779
RouteSelectThreshold types.Int64 `tfsdk:"route_select_threshold"`
790-
RTTVeto types.Int64 `tfsdk:"rtt_veto"`
791780
ForceNext types.Bool `tfsdk:"force_next"`
792-
RouteDiversity types.Int64 `tfsdk:"route_diversity"`
793781
}
794782

795783
type RouteShadersModel struct {
@@ -825,45 +813,33 @@ func RouteShaderDataToModel(data *RouteShaderData, model *RouteShaderModel) {
825813
model.Name = types.StringValue(data.RouteShaderName)
826814
model.ABTest = types.BoolValue(data.ABTest)
827815
model.AcceptableLatency = types.Int64Value(int64(data.AcceptableLatency))
828-
model.AcceptablePacketLossInstant = types.Float64Value(float64(data.AcceptablePacketLossInstant))
829-
model.AcceptablePacketLossSustained = types.Float64Value(float64(data.AcceptablePacketLossSustained))
830-
model.AnalysisOnly = types.BoolValue(data.AnalysisOnly)
816+
model.AcceptablePacketLoss = types.Float64Value(float64(data.AcceptablePacketLoss))
831817
model.BandwidthEnvelopeUpKbps = types.Int64Value(int64(data.BandwidthEnvelopeUpKbps))
832818
model.BandwidthEnvelopeDownKbps = types.Int64Value(int64(data.BandwidthEnvelopeDownKbps))
833819
model.DisableNetworkNext = types.BoolValue(data.DisableNetworkNext)
834820
model.LatencyReductionThreshold = types.Int64Value(int64(data.LatencyReductionThreshold))
835-
model.Multipath = types.BoolValue(data.Multipath)
836821
model.SelectionPercent = types.Float64Value(float64(data.SelectionPercent))
837822
model.MaxLatencyTradeOff = types.Int64Value(int64(data.MaxLatencyTradeOff))
838-
model.MaxNextRTT = types.Int64Value(int64(data.MaxNextRTT))
839823
model.RouteSwitchThreshold = types.Int64Value(int64(data.RouteSwitchThreshold))
840824
model.RouteSelectThreshold = types.Int64Value(int64(data.RouteSelectThreshold))
841-
model.RTTVeto = types.Int64Value(int64(data.RTTVeto))
842825
model.ForceNext = types.BoolValue(data.ForceNext)
843-
model.RouteDiversity = types.Int64Value(int64(data.RouteDiversity))
844826
}
845827

846828
func RouteShaderModelToData(model *RouteShaderModel, data *RouteShaderData) {
847829
data.RouteShaderId = uint64(model.Id.ValueInt64())
848830
data.RouteShaderName = model.Name.ValueString()
849831
data.ABTest = model.ABTest.ValueBool()
850832
data.AcceptableLatency = int(model.AcceptableLatency.ValueInt64())
851-
data.AcceptablePacketLossInstant = model.AcceptablePacketLossInstant.ValueFloat64()
852-
data.AcceptablePacketLossSustained = model.AcceptablePacketLossSustained.ValueFloat64()
853-
data.AnalysisOnly = model.AnalysisOnly.ValueBool()
833+
data.AcceptablePacketLoss = model.AcceptablePacketLoss.ValueFloat64()
854834
data.BandwidthEnvelopeUpKbps = int(model.BandwidthEnvelopeUpKbps.ValueInt64())
855835
data.BandwidthEnvelopeDownKbps = int(model.BandwidthEnvelopeDownKbps.ValueInt64())
856836
data.DisableNetworkNext = model.DisableNetworkNext.ValueBool()
857837
data.LatencyReductionThreshold = int(model.LatencyReductionThreshold.ValueInt64())
858-
data.Multipath = model.Multipath.ValueBool()
859838
data.SelectionPercent = model.SelectionPercent.ValueFloat64()
860839
data.MaxLatencyTradeOff = int(model.MaxLatencyTradeOff.ValueInt64())
861-
data.MaxNextRTT = int(model.MaxNextRTT.ValueInt64())
862840
data.RouteSwitchThreshold = int(model.RouteSwitchThreshold.ValueInt64())
863841
data.RouteSelectThreshold = int(model.RouteSelectThreshold.ValueInt64())
864-
data.RTTVeto = int(model.RTTVeto.ValueInt64())
865842
data.ForceNext = model.ForceNext.ValueBool()
866-
data.RouteDiversity = int(model.RouteDiversity.ValueInt64())
867843
}
868844

869845
func RouteShaderSchema() schema.Schema {
@@ -893,24 +869,12 @@ func RouteShaderSchema() schema.Schema {
893869
Computed: true,
894870
Default: int64default.StaticInt64(20),
895871
},
896-
"acceptable_packet_loss_instant": schema.Float64Attribute{
897-
Description: "The instantaneous packet loss that is acceptable. For example, setting to 1%% will allow packet loss up to 1%% in a 10 second period before enabling acceleration. Default is 0.25%%",
872+
"acceptable_packet_loss": schema.Float64Attribute{
873+
Description: "The packet loss that is acceptable. For example, setting to 1%% will allow packet loss up to 1%% before enabling acceleration. Default is 0.25%%",
898874
Optional: true,
899875
Computed: true,
900876
Default: float64default.StaticFloat64(0.25),
901877
},
902-
"acceptable_packet_loss_sustained": schema.Float64Attribute{
903-
Description: "The sustained packet loss that is acceptable. For example, setting to 0.1%% will allow packet loss up to 0.1%% in a 30 second period before enabling acceleration. Default is 0.1%%",
904-
Optional: true,
905-
Computed: true,
906-
Default: float64default.StaticFloat64(0.1),
907-
},
908-
"analysis_only": schema.BoolAttribute{
909-
Description: "Set this to true and acceleration is disabled. Analytics data will still be gathered from players of any buyer who use this route shader. Use this when you want to gather network perforance data for players, but you want accelerated turned off. Default is false.",
910-
Optional: true,
911-
Computed: true,
912-
Default: booldefault.StaticBool(false),
913-
},
914878
"bandwidth_envelope_up_kbps": schema.Int64Attribute{
915879
Description: "The maximum amount of acceleration bandwidth up in the client to server direction in kilobits per-second (kbps). Exceeding this amount of bandwidth for a session will result in packets above the limit not being accelerated. Default value is 1024 (1mbps).",
916880
Optional: true,
@@ -935,12 +899,6 @@ func RouteShaderSchema() schema.Schema {
935899
Computed: true,
936900
Default: int64default.StaticInt64(10),
937901
},
938-
"multipath": schema.BoolAttribute{
939-
Description: "If this is set to true then packets will be sent across the direct route (default internet path), as well as the network next path when a player is accelerated. Recommend setting this to true always. Default value is true.",
940-
Optional: true,
941-
Computed: true,
942-
Default: booldefault.StaticBool(true),
943-
},
944902
"selection_percent": schema.Float64Attribute{
945903
Description: "The percentage of players eligible for acceleration. For example, setting this to 10%% would only accelerate 1 in 10 players. Default value is 100%% (all players eligible for acceleration).",
946904
Optional: true,
@@ -953,12 +911,6 @@ func RouteShaderSchema() schema.Schema {
953911
Computed: true,
954912
Default: int64default.StaticInt64(20),
955913
},
956-
"max_next_rtt": schema.Int64Attribute{
957-
Description: "The maximum network next latency allowed. There is no point patting yourself on the back when you reduce 500ms latency to 450ms. 450ms is still completely unplayable! Set this value to the maximum reasonable accelerated latency that makes sense for your game. Network Next will not accelerate a player if their predicted post-acceleration latency is higher than this value. Default value is 250ms.",
958-
Optional: true,
959-
Computed: true,
960-
Default: int64default.StaticInt64(250),
961-
},
962914
"route_switch_threshold": schema.Int64Attribute{
963915
Description: "If a player is already being accelerated, and a better route is available with a reduction of at least this much milliseconds from the current route, then switch to it. Don't set this too low or sessions will switch routes every 10 seconds due to natural fluctuation. Default value is 10ms.",
964916
Optional: true,
@@ -971,24 +923,12 @@ func RouteShaderSchema() schema.Schema {
971923
Computed: true,
972924
Default: int64default.StaticInt64(5),
973925
},
974-
"rtt_veto": schema.Int64Attribute{
975-
Description: "If the accelerated latency becomes worse than the direct latency (default internet route) by this amount of milliseconds, then veto the session and stop accelerating the player. This is to avoid players hopping on/off of network next when latency fluctuation occurs. Don't set this too low, or players with fluctuating latency (due to edge issues or wifi) will fall off network next due to temporary high latency conditions. Default value is 20ms.",
976-
Optional: true,
977-
Computed: true,
978-
Default: int64default.StaticInt64(20),
979-
},
980926
"force_next": schema.BoolAttribute{
981927
Description: "Force all players to be accelerated. This is useful for testing, or if you have a small professional player base for whom you want to enable acceleration BEFORE anything goes wrong, instead of being reactive and only accelerating them after something goes wrong. Default is false.",
982928
Optional: true,
983929
Computed: true,
984930
Default: booldefault.StaticBool(false),
985931
},
986-
"route_diversity": schema.Int64Attribute{
987-
Description: "The minimum amount of distinct viable routes that must be available for a player to be accelerated. This setting can be useful to limit players in remote regions from taking network next when there is only one relay available to them. Only players with mulitple distinct paths will be accelerated, so there are backups if one relay becomse unroutable for this player. Don't set this too high or players with bad edge network conditions won't get accelerated. Default value is 0.",
988-
Optional: true,
989-
Computed: true,
990-
Default: int64default.StaticInt64(0),
991-
},
992932
},
993933
}
994934
}

0 commit comments

Comments
 (0)