beat.web.backend.models.worker module

class beat.web.backend.models.worker.WorkerManager[source]

Bases: django.db.models.manager.Manager

get_by_natural_key(name)[source]
class beat.web.backend.models.worker.Worker(id, name, active, update, updated, cores, memory, used_cores, used_memory, info)[source]

Bases: django.db.models.base.Model

name

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

active

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

update

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

updated

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

cores

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

memory

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

used_cores

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

used_memory

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

info

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects = <beat.web.backend.models.worker.WorkerManager object>
natural_key()[source]
get_admin_change_url()[source]
load()[source]

Calculates the number of cores in use or to be used in the future

current_load()[source]

Calculates the number of cores being used currently

available_cores()[source]

Calculates the number of available cores considering current load

as_dict()[source]

Returns a dictionary-like representation

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

slots

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

splits

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.