Skip to content

Commit

Permalink
Merge branch 'dev' into COG-970-refactor-tokenizing
Browse files Browse the repository at this point in the history
  • Loading branch information
dexters1 authored Jan 28, 2025
2 parents 6f8cbdb + 98f0f60 commit 710ca78
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions cognee/modules/data/models/MetricData.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
from datetime import datetime, timezone

from sqlalchemy import Column, DateTime, Float, Integer, ARRAY, UUID

from cognee.infrastructure.databases.relational import Base
from uuid import uuid4


class GraphMetricData(Base):
__tablename__ = "graph_metric_table"

# TODO: Change ID to reflect unique id of graph database
id = Column(UUID, primary_key=True, default=uuid4)
num_tokens = Column(Integer)
num_nodes = Column(Integer)
num_edges = Column(Integer)
mean_degree = Column(Float)
edge_density = Column(Float)
num_connected_components = Column(Integer)
sizes_of_connected_components = Column(ARRAY(Integer))
num_selfloops = Column(Integer, nullable=True)
diameter = Column(Integer, nullable=True)
avg_shortest_path_length = Column(Float, nullable=True)
avg_clustering = Column(Float, nullable=True)

created_at = Column(DateTime(timezone=True), default=lambda: datetime.now(timezone.utc))
updated_at = Column(DateTime(timezone=True), onupdate=lambda: datetime.now(timezone.utc))

0 comments on commit 710ca78

Please sign in to comment.