Skip to content

Commit

Permalink
[Deba] issue #23 partly resolved, description in my comment in issue …
Browse files Browse the repository at this point in the history
…thread
  • Loading branch information
debaghtk committed Jul 11, 2014
1 parent a82f660 commit 7b5d2ec
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,20 @@ angular.module('databases').
});


var arr =[];
var infodbarr =[];
var timearr = [];

$scope.infodbArr2=[1,2,3,4,5,6,7,8,];

$scope.infodbArr2=[0,1,2,3,4,5,6,7,8,9];

$scope.infodb.$promise.then(function(callback){
for(var i in $scope.infodbArr2){
arr[i] = parseInt($scope.infodb[i].content.used_memory);
var j = $scope.infodbArr2.length - 1 - i;
infodbarr[j] = parseInt($scope.infodb[i].content.used_memory)/1024;
timearr[j]=(($scope.infodb[i].timestamp.split('T'))[1].split('.'))[0];
}
$scope.infodbArr1 = arr;
$scope.timeArr=timearr;
$scope.infodbArr1 = infodbarr;
});

$scope.redisinfo = getinfo.get({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ angular.module('databases')
.directive('linechart', [
function() {
var directive = {};
directive.restrict = 'E';
directive.restrict = 'AE';
directive.scope = {
mem:'=mem',
time:'=time'
time:'=time',
xmarking:'=xcord'
};

directive.link = function(scope, element, attrs){
Expand All @@ -17,10 +18,11 @@ angular.module('databases')
scope.$watch( function(){
var timeArray=scope.time;
var memArray=scope.mem;
if(timeArray&&memArray&&entry){
if(timeArray&&memArray&&entry&&scope.xmarking){
entry=false;
var linePaper = Raphael('line');
linePaper.linechart(50,10,300,300, timeArray, memArray,{axis:'0 0 1 1', symbol: 'circle', smooth:false});
var linePaper = Raphael(element[0]);
linePaper.linechart(50,10,630,300, timeArray, memArray,{axis:'0 0 0 1', symbol: 'circle', smooth:false});
Raphael.g.axis(60, 300, 610, null, null, timeArray.length-1, 0, scope.xmarking, linePaper);
};
scope.$on('$destroy', function(){
linePaper.remove();
Expand Down
5 changes: 3 additions & 2 deletions public/modules/databases/views/view-database.client.view.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,9 @@ <h3>Redis Info for "{{database.name}}"</h3>
</div>
</form>
</div>
<div class="col-md-4 col-md-offset-1">
<linechart mem="infodbArr1" time="infodbArr2"><div id="line"></div></linechart>
<div class="col-md-8">
<h5> Readings in KB </h5>
<div linechart mem="infodbArr1" time="infodbArr2" xcord="timeArr" ></div>
</div>
</div>
</section>

0 comments on commit 7b5d2ec

Please sign in to comment.