Forum Discussion

Naman_65674's avatar
Naman_65674
Icon for Nimbostratus rankNimbostratus
Jun 28, 2010

Updating stats variable via Java

Hi Guys,

 

 

I am trying to update a variable in a statistics profile but I cant get it to work. When I print the values out before and after it seems to have set the variable but when I check the variable via CLI (b profile stats show) it doesnt seem to work. Any ideas?

 

 

public static void getStats() throws Exception {

 

Interfaces icontrolInterface = new Interfaces();

 

 

icontrolInterface.initialize("f5-host","admin","*****");

 

iControl.LocalLBProfileUserStatisticBindingStub m_profilestats = icontrolInterface.getLocalLBProfileUserStatistic();

 

String[] stats_name = {"test1_stats"};

 

iControl.LocalLBProfileUserStatisticProfileUserStatisticStatistics pr_stats = m_profilestats.get_statistics(stats_name);

 

 

for(int i=0; i< pr_stats.getStatistics().length; i++)

 

{

 

 

LocalLBProfileUserStatisticProfileUserStatisticStatisticEntry stats_entry = pr_stats.getStatistics();

 

LocalLBProfileUserStatisticUserStatistic[] user = stats_entry.getStatistics();

 

System.out.println(stats_entry.getProfile_name());

 

for (int j=0; j < user.length ;j++) {

 

System.out.println(user[j].getStatistic_key().readResolve());

 

System.out.println(user[j].getValue().getLow());

 

 

long low = 1;

 

long high = 0;

 

 

UsefulU64 var = new UsefulU64(high,low);

 

user[j].setValue(var);

 

System.out.println(user[j].getValue().getLow());

 

}

 

}

 

}

 

 

 

Note: I have used the helper class to set the 64 bit value: http://devcentral.f5.com/Tutorials/TechTips/tabid/63/articleType/ArticleView/articleId/78/A-class-to-handle-ULong64-return-values-in-Java.aspx

 

 

 

No RepliesBe the first to reply