Пример #1
0
class Data(juice.Command):
    """
    Sends some data for a transfer.
    """

    arguments = [('name', juice.String()), ('chunk', juice.Integer()),
                 (juice.BODY, juice.String())]
Пример #2
0
class CallItemMethod(juice.Command):
    """
    Invoke a particular method of a particular item.
    """
    commandName = 'Call-Item-Method'
    arguments = [('storepath', juice.Path()), ('storeid', juice.Integer()),
                 ('method', juice.String())]
Пример #3
0
class ResumeProcessor(juice.Command):
    """
    Cause a particular reliable listener to begin receiving notifications
    again.
    """
    commandName = 'Resume-Processor'
    arguments = [('storepath', juice.Path()), ('storeid', juice.Integer())]
Пример #4
0
class SuspendProcessor(juice.Command):
    """
    Prevent a particular reliable listener from receiving any notifications
    until a L{ResumeProcessor} command is sent or the batch process is
    restarted.
    """
    commandName = 'Suspend-Processor'
    arguments = [('storepath', juice.Path()), ('storeid', juice.Integer())]
Пример #5
0
class Get(juice.Command):
    """
    Tells the remote it should start sending me chunks of a file.
    """

    arguments = [("name", juice.String()),
                 ('mask', BitArrayArgument(optional=True))]

    response = [("size", juice.Integer())]  # number of octets!!
Пример #6
0
class Verify(juice.Command):
    """
    Verify that the checksum of the given chunk is correct.

    Errors:

      - chunk checksum incorrect
      - host hasn't computed checksum for that chunk yet.
    """

    arguments = [('name', juice.String()), ('peer', q2q.Q2QAddressArgument()),
                 ('chunk', juice.Integer()), ('sha1sum', juice.String())]
Пример #7
0
class GetList(juice.Command):
    commandName = 'getlist'
    arguments = [('length', juice.Integer())]
    response = [('body', juice.JuiceList([('x', juice.Integer())]))]
Пример #8
0
class DTMF(juice.Command):
    commandName = "DTMF"
    arguments = [('cookie', juice.String()), ("key", juice.Integer())]
Пример #9
0
class RTPStart(juice.Command):
    commandName = "Start"
    arguments = [('cookie', juice.String()), ("targethost", juice.String()),
                 ("targetport", juice.Integer())]
Пример #10
0
class Results(juice.Command):
    commandName = 'Result'
    arguments = [
        # Stats version - change this whenever the meaning of something changes
        # or a field is added or removed.
        ('version', juice.Integer()),

        # If an error occurred while collecting these stats - this probably
        # means they're bogus.
        ('error', juice.Boolean()),

        # If a particular timeout (See BasicProcess.connectionMade) elapsed
        # with no events whatsoever from the benchmark process.
        ('timeout', juice.Boolean()),

        # A unique name identifying the benchmark for which these are stats.
        ('name', juice.Unicode()),

        # The name of the benchmark associated with these stats.
        ('host', juice.Unicode()),

        # The sector size of the disk on which these stats were collected
        # (sectors are a gross lie, this is really the block size, and
        # everything else that talks about sectors is really talking about
        # blocks).
        ('sector_size', juice.Integer()),

        # Hex version info for the Python which generated these stats.
        ('python_version', juice.Unicode()),

        # Twisted SVN revision number used to generate these stats.
        ('twisted_version', juice.Unicode()),

        # Divmod SVN revision number used to generate these stats.
        ('divmod_version', juice.Unicode()),

        # Number of seconds between process startup and termination.
        ('elapsed', juice.Float()),

        # Size, in bytes, of the directory in which the child process was run.
        ('filesystem_growth', juice.Integer()),

        # Number of reads issued on the partition over the lifetime of the
        # child process.  This may include reads from other processes, if any
        # were active on the same disk when the stats were collected.
        ('read_count', juice.Integer(optional=True)),

        # Number of sectors which were read from the partition over the
        # lifetime of the child process. Same caveat as above.
        ('read_sectors', juice.Integer(optional=True)),

        # Number of writes issued to the partition over the lifetime of the
        # child process.  Same caveat as above.
        ('write_count', juice.Integer(optional=True)),

        # Number of sectors which were written to the partition over the
        # lifetime of the child process.  Same caveat as above.
        ('write_sectors', juice.Integer(optional=True)),

        # Number of milliseconds spent blocked on reading from the disk over
        # the lifetime of the child process.  Same caveat as above.
        ('read_ms', juice.Integer(optional=True)),

        # Number of milliseconds spent blocked on writing to the disk over the
        # lifetime of the child process.  Same caveat as above.
        ('write_ms', juice.Integer(optional=True)),
    ]