Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
kswapd committed Jul 5, 2018
1 parent 1bf0592 commit 459d5c7
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 4 deletions.
25 changes: 22 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
![logo](http://dcits.com/statics/images/dcits/logo.png)

## Introduction
A time series database middleware to connect InfluxDB, support **JPA**-compatible entity definition and method declaration. After the measurement models definition and corresponding generic type interface declaration, you can query and save influxDB data as a normal java bean.
A time series database object-relational mapping(ORM) library, support **JPA**-compatible entity definition and method declaration. After the measurement models definition and corresponding generic type interface declaration, you can query and save influxDB data as a normal java bean.


## Requirement
Expand All @@ -17,8 +17,10 @@ A time series database middleware to connect InfluxDB, support **JPA**-compatibl
## Features
* It aims to response queries in real-time, which means every data point is indexed as it comes in and is immediately available in queries that should return in < 100ms.
* JPA-compatible query syntax, support operator **AND,OR,NOT,BEFORE,AFTER,GREATERTHAN, LESSTHAN** etc.
* No redundant XML configuration, annotation type programming.
* Support data source connection pool, improve data access performance.
* Do not need to implement repository operator, **just declare corresponding interface and use it**.
* Minimum dependency installation.
* Do not need to implement your repository class, **just declare responding interface and use it**.

## Prerequisites
* Install InfluxDB **version 1.5.2** and chronograf as InfluxDB web UI.
Expand Down Expand Up @@ -114,12 +116,14 @@ public class Memory extends PercentMeasuerment {

```
//Cpu measurement repository
package com.dcits.repo.othermetrics;
public interface RepoCpu extends CustomRepo<Cpu> {
}
```
Or more complex JPA-compatible interface declaration
```
package com.dcits.repo.memory;
public interface RepoMemory extends CustomRepo<Memory> {
public List<Memory> findByIpAddrOrderByTimeDescLimit(String ip, int limit);
Expand All @@ -131,9 +135,24 @@ public interface RepoMemory extends CustomRepo<Memory> {
```

To make interface above be found and implemented, we add package that contain interfaces within annotation:
```
package com.dcits.app;
@EnableRepoInterfaceScan({"com.dcits.repo"});
public class Application {
...
...
}
```

To make this annotation acitve, add this package in your xml:
```
<context:component-scan base-package="com.dcits.app"></context:component-scan>
```

### JPA method usage
### JPA method usage examples
```
//corresponding influxdb sql: select * from memory where "ipAddr"="192.168.1.100" order by time desc limit 5
Expand Down
2 changes: 1 addition & 1 deletion tsdb-express-examples/src/main/resources/tsdb.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd">
<context:property-placeholder location="classpath*:tsdb.properties" />
<context:component-scan base-package="com.dcits.app,com.dcits.repo.models"></context:component-scan>
<context:component-scan base-package="com.dcits.app"></context:component-scan>
<aop:aspectj-autoproxy />

</beans>

0 comments on commit 459d5c7

Please sign in to comment.