Implementação de um serviço de registo de eventos em séries temporais e de agregação de informação, acessível remotamente através de um servidor. É possível consultar o respetivo enunciado e relatório.
Para executar este projeto é necessário ter instalado:
- Java JDK 17 (ou superior)
- GNU Make
- MariaDB Server
ℹ️ O driver JDBC da MariaDB (
mariadb-java-client-2.7.1.jar) já está incluído na pastalib/, e aMakefileadiciona automaticamente todos os.jardesta pasta ao classpath.
O servidor utiliza a base de dados MariaDB para persistência de dados.
Após instalar o MariaDB, é necessário executar os seguintes comandos:
CREATE DATABASE base_dados_sd;
CREATE USER IF NOT EXISTS 'me'@'localhost' IDENTIFIED BY 'mypass';
GRANT ALL PRIVILEGES ON base_dados_sd.* TO 'me'@'localhost';
FLUSH PRIVILEGES;Para compilar os ficheiros executáveis do servidor, do cliente e de testes, basta fazer:
$ cd registoDeEventos
$ makePara executar o servidor, basta fazer:
$ make server <D> <S> <W> <I> [RESET]-
<D>– número de séries que o servidor deve contabilizar para as suas operações -
<S>- número de séries que o servidor deve manter em memória -
<W>- número de threads responsáveis pela execução de tarefas (tamanho da ThreadPool) -
<I>- tempo de intervalo entre a passagem de dias -
[RESET]- flag opcional que apaga todas as entradas das bases de dados (com exceção da dos utilizadores).
Para executar o cliente, basta:
$ make clienteE a partir daqui poderá interagir com o servidor através do menu apresentado. Para mais informações, pode consultar o relatório.
Foram desenvolvidos alguns scripts para testar o funcionamento do servidor e do cliente. Para os executar, basta ter o servidor a correr e escolher um dos seguintes comandos:
$ make insert-test
$ make insert-test-invalid
$ make insert-test-finalO primeiro comando executa um teste de inserções de eventos, o segundo um teste de inserções de eventos inválidos e o terceiro, um teste que envolve várias operações. No fim de cada teste, são apresentados alguns resultados estatísticos na pasta scripts/results.
Para gerar a documentação do projeto, basta fazer:
$ cd registoDeEventos
$ make docIrá ser criada uma pasta docs com a documentação gerada. Para aceder à documentação, basta abrir o ficheiro index.html que se encontra dentro da pasta docs. Por exemplo:
$ cd docs
$ xdg-open index.htmlPara apagar os ficheiros compilados, basta fazer:
$ cd registoDeEventos
$ make cleanÉ de notar que os ficheiros de resultado da execução de scripts não são apagados com este comando.
Implementation of a time-series event logging and information aggregation service, remotely accessible through a server. You can consult the corresponding project specification and report.
To run this project, the following must be installed:
- Java JDK 17 (or higher)
- GNU Make
- MariaDB Server
ℹ️ The MariaDB JDBC driver (
mariadb-java-client-2.7.1.jar) is already included in thelib/folder, and theMakefileautomatically adds all.jarfiles in this folder to the classpath.
The server uses a MariaDB database for data persistence.
After installing MariaDB, the following commands must be executed:
CREATE DATABASE base_dados_sd;
CREATE USER IF NOT EXISTS 'me'@'localhost' IDENTIFIED BY 'mypass';
GRANT ALL PRIVILEGES ON base_dados_sd.* TO 'me'@'localhost';
FLUSH PRIVILEGES;To compile the server, client, and test executables, simply run:
$ cd registoDeEventos
$ makeTo run the server:
$ make server <D> <S> <W> <I> [RESET]<D>– number of series the server should account for in its operations<S>– number of series the server should keep in memory<W>– number of threads responsible for task execution (ThreadPool size)<I>– time interval between day transitions[RESET]– optional flag that deletes all database entries (except user data)
To run the client:
$ make clienteFrom this point on, you can interact with the server through the presented menu. For more information, consult the report.
Several scripts were developed to test the server and client functionality. To run them, make sure the server is running and then execute one of the following commands:
$ make insert-test
$ make insert-test-invalid
$ make insert-test-finalThe first command runs a test for event insertions, the second runs a test for invalid event insertions, and the third runs a test involving multiple operations. At the end of each test, some statistical results are presented in the scripts/results folder.
To generate the project documentation, run:
$ cd registoDeEventos
$ make docA docs folder containing the generated documentation will be created. To access the documentation, simply open the index.html file inside the docs folder. For example:
$ cd docs
$ xdg-open index.htmlTo remove compiled files, run:
$ cd registoDeEventos
$ make cleanNote that the result files generated by the test scripts are not removed by this command.