7020cb0dbd646a9a5dfc88aed62696507ab45c3e,perfkitbenchmarker/gcp/gce_virtual_machine.py,GceVirtualMachine,CreateScratchDisk,#GceVirtualMachine#Any#,157

Before Change


    
    name = "%s-scratch-%s" % (self.name, len(self.scratch_disks))
    scratch_disk = gce_disk.GceDisk(disk_spec, name, self.zone, self.project)
    self.scratch_disks.append(scratch_disk)

    if scratch_disk.disk_type == disk.LOCAL:
      if self.local_drive_counter >= self.max_local_drives:
        raise errors.Error("Not enough local drives.")
      scratch_disk.name = "local-ssd-%d" % self.local_drive_counter
      self.local_drive_counter += 1
    else:
      scratch_disk.Create()
      scratch_disk.Attach(self)

    self.FormatDisk(scratch_disk.GetDevicePath())
    self.MountDisk(scratch_disk.GetDevicePath(), disk_spec.mount_point)

  def GetName(self):
    Get a GCE VM"s unique name.
    return self.name

After Change


    
    // Get the names for the disk(s) we are going to create.
    if disk_spec.disk_type == disk.LOCAL:
      new_count = self.local_drive_counter + disk_spec.num_striped_disks
      if new_count > self.max_local_drives:
        raise errors.Error("Not enough local drives.")
      disk_names = ["local-ssd-%d" % i
                    for i in range(self.local_drive_counter, new_count)]
      self.local_drive_counter = new_count
    else:
      disk_names = ["%s-data-%d-%d" % (self.name, len(self.scratch_disks), i)
                    for i in range(disk_spec.num_striped_disks)]

    // Instantiate the disk(s).
    disks = [gce_disk.GceDisk(disk_spec, name, self.zone, self.project)
             for name in disk_names]

    self._CreateScratchDiskFromDisks(disk_spec, disks)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 10

Instances


Project Name: GoogleCloudPlatform/PerfKitBenchmarker
Commit Name: 7020cb0dbd646a9a5dfc88aed62696507ab45c3e
Time: 2015-05-08
Author: ehankland@google.com
File Name: perfkitbenchmarker/gcp/gce_virtual_machine.py
Class Name: GceVirtualMachine
Method Name: CreateScratchDisk


Project Name: GoogleCloudPlatform/PerfKitBenchmarker
Commit Name: 7020cb0dbd646a9a5dfc88aed62696507ab45c3e
Time: 2015-05-08
Author: ehankland@google.com
File Name: perfkitbenchmarker/aws/aws_virtual_machine.py
Class Name: AwsVirtualMachine
Method Name: CreateScratchDisk


Project Name: GoogleCloudPlatform/PerfKitBenchmarker
Commit Name: 7020cb0dbd646a9a5dfc88aed62696507ab45c3e
Time: 2015-05-08
Author: ehankland@google.com
File Name: perfkitbenchmarker/azure/azure_virtual_machine.py
Class Name: AzureVirtualMachine
Method Name: CreateScratchDisk


Project Name: GoogleCloudPlatform/PerfKitBenchmarker
Commit Name: 7020cb0dbd646a9a5dfc88aed62696507ab45c3e
Time: 2015-05-08
Author: ehankland@google.com
File Name: perfkitbenchmarker/gcp/gce_virtual_machine.py
Class Name: GceVirtualMachine
Method Name: CreateScratchDisk