Skip to content

Feat/sensor aggregated data#4

Merged
YutaroNegi merged 13 commits intomainfrom
feat/sensor-aggregated-data
Dec 1, 2024
Merged

Feat/sensor aggregated data#4
YutaroNegi merged 13 commits intomainfrom
feat/sensor-aggregated-data

Conversation

@YutaroNegi
Copy link
Copy Markdown
Owner

Listagem de Dados Agregados

Endpoints

  • GET /sensor-data/aggregated
    • Consulta dados agregados da tabela aggregated no DynamoDB.

    • Suporta filtros dinâmicos:

      • 24h: últimas 24 horas
      • 48h: últimas 48 horas
      • 1w: última semana
      • 1m: último mês
    • Parâmetros de consulta:

      • interval: Especifica o intervalo de tempo (24h, 48h, 1w, 1m).
    • Exemplo de requisição:

      GET /sensor-data/aggregated?interval=24h
    • Exemplo de resposta:

      {
        "average": 78.42,
        "totalCount": 20,
        "items": [
          {
            "equipmentId": "EQ-12495",
            "intervalStart": 1693468800,
            "totalValue": 1500.75,
            "sampleCount": 20
          }
        ]
      }

Processamento de Arquivos com Lambda

Uma função Lambda em Python é responsável por processar os arquivos CSV enviados para o S3. Esta função:

  • Lê o arquivo CSV utilizando pandas.
  • Insere cada linha do arquivo no DynamoDB com as colunas:
    • id (UUID gerado automaticamente)
    • equipmentId
    • timestamp
    • value
    • register_time

@YutaroNegi YutaroNegi merged commit 2f0df58 into main Dec 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant