Skip to content

Dalphi/profiler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Dalphi profiler

A component to profile and test a Dalphi setup.

Usage

./profiler.rb https://dalphi.example.com /path/to/my/profile.rb

Creating a profile

It is possible to create a profile by writing the desired use cases to be profiled to a Ruby file.

Registration

The registration object allows to register_admin and unregister_admin.

registration = DalphiProfiler::Registration.new email: '[email protected]',
                                                password: 'Pb9bWr42Lw01Vm'

registration.register_admin # registers an administrator with the specified credentials
registration.unregister_admin # unregisters an administrator with specified email

Authentification

The authentification object is capable of login_admin and logout_admin.

authentification = DalphiProfiler::Authentification.new email: '[email protected]',
                                                        password: 'Pb9bWr42Lw01Vm'

authentification.login_admin # logs in an administrator with the specified credentials
authentification.logout_admin # logs out any logged in administrator

Service

The service object is capable of register and unregister itself.

service = DalphiProfiler::Service url: 'http:https://service.example.com:1234/api/v1'

service.register # registers the service identified by its URL
service.unregister # unregisters the service identified by its URL

Interface

The interface object can create an instance of itself.

interface = DalphiProfiler::Interface.new title: 'NER complete',
                                          interface_type_name: 'ner_complete',
                                          associated_problem_identifiers: 'ner',
                                          html: File.read("#{Dir.pwd}/interface.html"),
                                          coffee: File.read("#{Dir.pwd}/interface.coffee"),
                                          scss: File.read("#{Dir.pwd}/interface.scss")
interface.create # creates an interface specified by its properties

Project

The project object can create and destroy a project.

project = DalphiProfiler::Project.new title: 'bluetooth port indexing',
                                      description: "I'll override the cross-platform IB panel, that should bus the JSON interface!",
                                      iterate_service: 'MaxEnt NER Iterator (synchronous)',
                                      merge_service: 'RawDatum replacer (synchronous)',
                                      interfaces: { 'ner_complete' => 'NER complete' }

project.create # creates a project with the specified preferences
project.destroy # destroys a project with the specified title

Annotator

The annotator object can create and destroy an annotator. Project access can be granted with assign_to_project and unassign_from_project.

annotator = DalphiProfiler::Annotator.new name: 'Kailey Ledner',
                                          email: '[email protected]',
                                          password: 'Gn2gLp5v0nZ8Zj'

annotator.create # creates an annotator with the specified name and credentials
annotator.destroy # destroys an annotator identified by the name

annotator.assign_to_project project_title: 'bluetooth port indexing' # assignes the annotator identified by the name and email to the project identified by its title
annotator.unassign_from_project project_title: 'bluetooth port indexing' # unassignes the annotator identified by its name from the project identified by its title

RawDatum

The raw_datum object can create a datum and destroy_all of them.

raw_datum = DalphiProfiler::RawDatum.new project_title: 'bluetooth port indexing',
                                         files: ['/path/to/your/raw_datum_1.json', '/path/to/your/raw_datum_2.json']

raw_datum.create # creates a raw datum with the given file for the project with the specified project title
raw_datum.destroy_all # destroys all raw data associated to the project with the given title

AnnotationDocument

The annotation_document object can create a datum and destroy_all of them.

annotation_document = DalphiProfiler::AnnotationDocument.new project_title: 'bluetooth port indexing'

annotation_document.create # creates an annotation document for the project with the specified project title
annotation_document.destroy_all # destroys all annotation documents associated to the project with the given title

Annotation

The annotation object can annotate an annotation document or merge all annotated annotation documents.

annotation = DalphiProfiler::Annotation.new project_title: 'bluetooth port indexing'

annotation.annotate label_words: { 'PER': ['Linus Torvalds', 'Richard Stallman'], 'COM': ['Linux Foundation', 'Canonical'] } # annotates one annotation document with the given words for the coresponding labels
annotation.merge # merges all annotated annotation documents back to the corresponding raw datum

About

A component to profile and test a Dalphi setup.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages