Authored by qinchao

docker 监控

... ... @@ -22,4 +22,10 @@ public class DockerJenkinsRecord {
* 创建时间
*/
private Date createTime;
/**
* jenkins
* 回调时间
*/
private Date updateCallbackTime;
}
... ...
... ... @@ -13,10 +13,11 @@
<result column="jenkins_build_status" property="jenkinsBuildStatus" jdbcType="VARCHAR" />
<result column="release_work_id" property="releaseWorkId" jdbcType="VARCHAR" />
<result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
<result column="update_callback_time" property="updateCallbackTime" jdbcType="TIMESTAMP" />
</resultMap>
<sql id="Base_Column_List" >
id, projectname, clusterid,namespace,dockerprojectname,jenkins_job_id,jenkins_build_status,release_work_id,create_time
id, projectname, clusterid,namespace,dockerprojectname,jenkins_job_id,jenkins_build_status,release_work_id,create_time,update_callback_time
</sql>
<select id="selectById" resultMap="BaseResultMap">
... ... @@ -30,7 +31,7 @@
select
<include refid="Base_Column_List" />
from docker_jenkins_record
where create_time>=DATE_SUB(NOW(),INTERVAL 3 MINUTE)
where update_callback_time>=DATE_SUB(NOW(),INTERVAL 3 MINUTE)
</select>
... ... @@ -41,7 +42,7 @@
<update id="updateJob" >
update docker_jenkins_record
set jenkins_job_id = #{jobId} ,jenkins_build_status = #{jobStatus}
set jenkins_job_id = #{jobId} ,jenkins_build_status = #{jobStatus},update_callback_time=now()
where id = #{id}
</update>
... ...