Skip to content

client rate < 1 in hunts is handled (but not displayed) correctly #471

@hillu

Description

@hillu

Hi,

when I define a hunt with a client rate between 0 and 1, the correct value seems to be stored: In my lab setup it has been possible to reliably schedule one flow per 20min or so. (I need this to be able to run resource-intensive flows on machines that run in overbooked VM environments without risking to bring everything to a halt.)

However, the hunt overview page tells me "No client limit". I found this in the templates:

  <dt>Client Rate (clients/min)</dt>
  {% if this.client_rate == 0.0 %}
    <dd>No rate limit</dd>
  {% else %}
    <dd>{{ this.client_rate|escape }}</dd>
  {% endif %}

Apparently, client_rate has been truncated to an integer value somewhere... Indeed, while HuntRunnerArgs.client_rate defines flows.proto as a float, but api.proto defines ApiHunt.client_rate as an int64.

Would it make sense to change it like this?

diff --git a/grr/proto/api.proto b/grr/proto/api.proto
index 29ed33e..6de1e6c 100644
--- a/grr/proto/api.proto
+++ b/grr/proto/api.proto
@@ -1414,7 +1414,7 @@ message ApiHunt {
   optional int64 client_limit = 10 [(sem_type) = {
       description: "Client limit.",
     }];
-  optional int64 client_rate = 11 [(sem_type) = {
+  optional float client_rate = 11 [(sem_type) = {
       description: "Client rate.",
     }];
   optional uint64 created = 12 [(sem_type) = {

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions