Performance
Repository
The PerformanceRepository
interface is
useful to manage the queries for the performance data operations
Author
N7ghtm4r3 - Tecknobit
See also
JpaRepository
Functions
Link copied to clipboard
@Query(value = ""SELECT * FROM " + PERFORMANCE_ANALYTICS_KEY +
" WHERE " + APPLICATION_IDENTIFIER_KEY + "=:" + APPLICATION_IDENTIFIER_KEY +
" AND " + PLATFORM_KEY + "=:" + PLATFORM_KEY +
" AND " + PERFORMANCE_ANALYTIC_TYPE_KEY + "=:#{#" + PERFORMANCE_ANALYTIC_TYPE_KEY + ".name()}" +
" AND " + CREATION_DATE_KEY + " BETWEEN :" + INITIAL_DATE_KEY + " AND :" + FINAL_DATE_KEY +
" AND (" +
"COALESCE(:" + VERSION_FILTERS_KEY + ") IS NULL OR " +
APP_VERSION_KEY + " IN (:" + VERSION_FILTERS_KEY + ")" +
")" +
" ORDER BY " + APP_VERSION_KEY",
nativeQuery = true
)
Method to retrieve the collected performance
data from the database
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
@Query(value = "SELECT DISTINCT " + APP_VERSION_KEY + " FROM " + PERFORMANCE_ANALYTICS_KEY +
" WHERE " + APPLICATION_IDENTIFIER_KEY + "=:" + APPLICATION_IDENTIFIER_KEY +
" AND " + PLATFORM_KEY + "=:" + PLATFORM_KEY +
" AND " + PERFORMANCE_ANALYTIC_TYPE_KEY + "=:#{#" + PERFORMANCE_ANALYTIC_TYPE_KEY + ".name()}",
nativeQuery = true
)
Method to get all the available versions
target for a specific analytic
Link copied to clipboard
@Query(value = ""SELECT DISTINCT " + APP_VERSION_KEY + " FROM " + PERFORMANCE_ANALYTICS_KEY +
" WHERE " + APPLICATION_IDENTIFIER_KEY + "=:" + APPLICATION_IDENTIFIER_KEY +
" AND " + PLATFORM_KEY + "=:" + PLATFORM_KEY +
" AND " + PERFORMANCE_ANALYTIC_TYPE_KEY + "=:#{#" + PERFORMANCE_ANALYTIC_TYPE_KEY + ".name()}" +
" LIMIT " + MAX_VERSION_SAMPLES",
nativeQuery = true
)
Method to get all the available versions
target for a specific analytic limited for the chart data
presentation
Link copied to clipboard
@Query(value = ""SELECT * FROM " + PERFORMANCE_ANALYTICS_KEY +
" WHERE " + APPLICATION_IDENTIFIER_KEY + "=:" + APPLICATION_IDENTIFIER_KEY +
" AND " + APP_VERSION_KEY + "=:" + APP_VERSION_KEY +
" AND " + PLATFORM_KEY + "=:#{#" + PLATFORM_KEY + ".name()}" +
" AND " + PERFORMANCE_ANALYTIC_TYPE_KEY + "=:#{#" + PERFORMANCE_ANALYTIC_TYPE_KEY + ".name()}" +
" AND " + CREATION_DATE_KEY + "=:" + CREATION_DATE_KEY",
nativeQuery = true
)
Method to retrieve an analytic by date
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
@Modifying(clearAutomatically = true
)
@Query(value = "INSERT INTO " + PERFORMANCE_ANALYTICS_KEY + " (" +
IDENTIFIER_KEY + "," +
CREATION_DATE_KEY + "," +
APP_VERSION_KEY + "," +
PLATFORM_KEY + "," +
DATA_UPDATES_KEY + "," +
PERFORMANCE_ANALYTIC_TYPE_KEY + "," +
PERFORMANCE_VALUE_KEY + "," +
APPLICATION_IDENTIFIER_KEY +
") VALUES (" +
":" + IDENTIFIER_KEY + "," +
":" + CREATION_DATE_KEY + "," +
":" + APP_VERSION_KEY + "," +
":#{#" + PLATFORM_KEY + ".name()}" + "," +
":" + DATA_UPDATES_KEY + "," +
":#{#" + PERFORMANCE_ANALYTIC_TYPE_KEY + ".name()}" + "," +
":" + PERFORMANCE_VALUE_KEY + "," +
":" + APPLICATION_IDENTIFIER_KEY +
")",
nativeQuery = true
)
Method to store a new analytic in the
system
Link copied to clipboard
@Modifying(clearAutomatically = true
)
@Query(value = ""UPDATE " + PERFORMANCE_ANALYTICS_KEY + " SET " +
DATA_UPDATES_KEY + "=:" + DATA_UPDATES_KEY + "," +
PERFORMANCE_VALUE_KEY + "=:" + PERFORMANCE_VALUE_KEY +
" WHERE " + IDENTIFIER_KEY + "=:" + IDENTIFIER_KEY +
" AND " + CREATION_DATE_KEY + "=:" + CREATION_DATE_KEY +
" AND " + APP_VERSION_KEY + "=:" + APP_VERSION_KEY +
" AND " + PLATFORM_KEY + "=:#{#" + PLATFORM_KEY + ".name()}" +
" AND " + PERFORMANCE_ANALYTIC_TYPE_KEY + "=:#{#" + PERFORMANCE_ANALYTIC_TYPE_KEY + ".name()}" +
" AND " + APPLICATION_IDENTIFIER_KEY + "=:" + APPLICATION_IDENTIFIER_KEY",
nativeQuery = true
)
Method to update an existing analytic in the
system