<commit_before>/*
 * Copyright 2019 Google Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * You may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions
 * and limitations under the License.
 */

package com.google.pubsub.flic.controllers.resource_controllers;

import com.google.api.client.googleapis.json.GoogleJsonResponseException;
import com.google.api.services.compute.Compute;
import com.google.api.services.compute.model.*;
import com.google.common.collect.ImmutableList;
import com.google.common.util.concurrent.*;
import com.google.pubsub.flic.controllers.Client;
import com.google.pubsub.flic.controllers.ClientParams;
import java.io.IOException;
import java.util.*;
import java.util.concurrent.ScheduledExecutorService;
import javax.annotation.Nullable;
import org.apache.http.HttpStatus;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/** A ResourceController which manages compute resource_controllers */
public class GCEComputeResourceController extends ComputeResourceController {
  private static final String MACHINE_TYPE = "n1-standard-"; // standard machine prefix
  private static final String SOURCE_FAMILY =
      "projects/ubuntu-os-cloud/global/images/ubuntu-1604-xenial-v20171026a"; // Ubuntu 16.04 LTS

  protected static final Logger log = LoggerFactory.getLogger(GCEComputeResourceController.class);
  private final String project;
  private final ClientParams params;
  private final Integer count;
  private final ScheduledExecutorService executor;
  private final Compute compute;

  public GCEComputeResourceController(
      String project,
      ClientParams params,
      Integer count,
      ScheduledExecutorService executor,
      Compute compute) {
    super(executor);
    this.project = project;
    this.params = params;
    this.count = count;
    this.executor = executor;
    this.compute = compute;
  }

  private String instanceName() {
    return "cps-loadtest-"
        + params.getClientType()<commit_msg>fix: use ubuntu-2004-focal-v20210720 as GCE VM source image<commit_after>/*
 * Copyright 2019 Google Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * You may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions
 * and limitations under the License.
 */

package com.google.pubsub.flic.controllers.resource_controllers;

import com.google.api.client.googleapis.json.GoogleJsonResponseException;
import com.google.api.services.compute.Compute;
import com.google.api.services.compute.model.*;
import com.google.common.collect.ImmutableList;
import com.google.common.util.concurrent.*;
import com.google.pubsub.flic.controllers.Client;
import com.google.pubsub.flic.controllers.ClientParams;
import java.io.IOException;
import java.util.*;
import java.util.concurrent.ScheduledExecutorService;
import javax.annotation.Nullable;
import org.apache.http.HttpStatus;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/** A ResourceController which manages compute resource_controllers */
public class GCEComputeResourceController extends ComputeResourceController {
  private static final String MACHINE_TYPE = "n1-standard-"; // standard machine prefix
  private static final String SOURCE_FAMILY =
      "projects/ubuntu-os-cloud/global/images/ubuntu-2004-focal-v20210720"; // Ubuntu 20.04 LTS

  protected static final Logger log = LoggerFactory.getLogger(GCEComputeResourceController.class);
  private final String project;
  private final ClientParams params;
  private final Integer count;
  private final ScheduledExecutorService executor;
  private final Compute compute;

  public GCEComputeResourceController(
      String project,
      ClientParams params,
      Integer count,
      ScheduledExecutorService executor,
      Compute compute) {
    super(executor);
    this.project = project;
    this.params = params;
    this.count = count;
    this.executor = executor;
    this.compute = compute;
  }

  private String instanceName() {
    return "cps-loadtest-"
        + params.getClientType()
{'fraction_non_alphanumeric': 0.08333333333333333, 'fraction_numerical': 0.01375, 'mean_word_length': 4.376259798432251, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5775874', 'n_tokens_mistral': 1348, 'n_tokens_neox': 1282, 'n_words': 400}